mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
New hook beforeRunCronJob and afterRunCronJob (#29884)
This commit is contained in:
parent
185c703c64
commit
c8dd1fbd72
|
|
@ -281,6 +281,10 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
|||
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) {
|
||||
|
|
@ -307,6 +311,9 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
|||
}
|
||||
|
||||
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";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user