Skip to content

Commit

Permalink
Cache list of all config files for unlock, in case one was removed ht…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Mar 20, 2021
1 parent 5aa43b4 commit b14e728
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions virtualmin-nginx-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ sub flush_config_file_lines
sub lock_all_config_files
{
my ($parent) = @_;
foreach my $f (&get_all_config_files($parent)) {
@lock_all_config_files_cache = &get_all_config_files($parent);
foreach my $f (@lock_all_config_files_cache) {
&lock_file($f);
}
}
Expand All @@ -394,9 +395,10 @@ sub lock_all_config_files
sub unlock_all_config_files
{
my ($parent) = @_;
foreach my $f (reverse(&get_all_config_files($parent))) {
foreach my $f (reverse(@lock_all_config_files_cache)) {
&unlock_file($f);
}
@lock_all_config_files_cache = ();
}

# get_all_config_files([&parent])
Expand Down

0 comments on commit b14e728

Please sign in to comment.