Skip to content

Commit

Permalink
Fix for generic agent: Scheduled job immediate executed after schedul…
Browse files Browse the repository at this point in the history
…e was changed. (#406)
  • Loading branch information
pboguslawski authored Feb 22, 2024
1 parent 4cd26a7 commit 521fa9b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Kernel/System/GenericAgent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use Kernel::System::VariableCheck qw(:all);
our @ObjectDependencies = (
'Kernel::Config',
'Kernel::System::Cache',
'Kernel::System::Daemon::SchedulerDB',
'Kernel::System::DateTime',
'Kernel::System::DB',
'Kernel::System::DynamicField',
Expand Down Expand Up @@ -855,6 +856,10 @@ sub JobDelete {
Type => 'GenericAgent',
);

# Remove job record from scheduler DB to avoid job immediate execution if redefined
# with different schedule.
$Kernel::OM->Get('Kernel::System::Daemon::SchedulerDB')->GenericAgentTaskCleanup();

return 1;
}

Expand Down

0 comments on commit 521fa9b

Please sign in to comment.