Skip to content

Commit

Permalink
New hook beforeRunCronJob and afterRunCronJob
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Jun 7, 2024
1 parent 60c8470 commit 7c159a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/cron/cron_run_jobs.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@
dol_syslog("cron_run_jobs.php::fetch Error ".$cronjob->error, LOG_ERR);
exit(1);
}

$parameters = array('cronjob' => $cronjob, 'line' => $line);
$reshook = $hookmanager->executeHooks('beforeRunCronJob', $parameters, $object);

// Execute job
$result = $cronjob->run_jobs($userlogin);
if ($result < 0) {
Expand All @@ -286,6 +290,9 @@
}

echo "Job re-scheduled\n";

$parameters = array('cronjob' => $cronjob, 'line' => $line);
$reshook = $hookmanager->executeHooks('afterRunCronJob', $parameters, $object);
} else {
echo " - not qualified (datenextrunok=".($datenextrunok ?: 0).", datestartok=".($datestartok ?: 0).", dateendok=".($dateendok ?: 0).")\n";

Expand Down

0 comments on commit 7c159a0

Please sign in to comment.