diff --git a/webservices/cron.php b/webservices/cron.php index 7a381b3e88..9e06fd50c6 100644 --- a/webservices/cron.php +++ b/webservices/cron.php @@ -74,6 +74,10 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit) { $oNow = new DateTime(); $fStart = microtime(true); + $oCtx = new ContextTag('CRON:Task:'.$oTask->Get('class_name')); + + $sMessage = ""; + $oExceptionToThrow = null; try { $sMessage = $oProcess->Process($iTimeLimit); @@ -114,6 +118,8 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit) $oTask->Set('next_run_date', $oPlannedStart->format('Y-m-d H:i:s')); $oTask->DBUpdate(); + unset($oCtx); + return $sMessage; }