From 96288db97ba9075b1dcc728527b8dd02fd7b2e0b Mon Sep 17 00:00:00 2001 From: Guillaume Lajarige Date: Fri, 29 Dec 2017 09:59:37 +0000 Subject: [PATCH] =?UTF-8?q?(Retrofit=20from=20trunk)=20N=C2=B01132=20Add?= =?UTF-8?q?=20ContextTag=20on=20CRON=20background=20tasks=20(eg.=20"CRON:T?= =?UTF-8?q?ask:").?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduced for the "Mail to ticket automation" extension, so we know when a Ticket is created/updated from an email. SVN:2.4[5182] --- webservices/cron.php | 6 ++++++ 1 file changed, 6 insertions(+) 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; }