Skip to content

Commit

Permalink
fix: Load toolbox yaml if not loaded when checked for toolbox enabled…
Browse files Browse the repository at this point in the history
… jobs
  • Loading branch information
g-bougard committed Dec 17, 2024
1 parent 4eba318 commit 26c880b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/GLPI/Agent/HTTP/Server/ToolBox.pm
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,15 @@ sub read_yaml {
sub reload_yaml_on_change {
my ($self) = @_;

return unless $self->{_yaml_loaded_time};

my $reload_needed = 0;
foreach my $file (keys(%{$self->{_yaml_loaded_time}})) {
my $mtime = stat($file)->mtime;
if ($mtime > $self->{_yaml_loaded_time}->{$file}) {
$reload_needed++;
$self->debug("Reloading YAML files on $file update");
last;
my $reload_needed = $self->{_yaml_loaded_time} ? 0 : 1;
unless ($reload_needed) {
foreach my $file (keys(%{$self->{_yaml_loaded_time}})) {
my $mtime = stat($file)->mtime;
if ($mtime > $self->{_yaml_loaded_time}->{$file}) {
$reload_needed++;
$self->debug("Reloading YAML files on $file update");
last;
}
}
}

Expand Down

0 comments on commit 26c880b

Please sign in to comment.