N°1132 Add ContextTag on CRON background tasks (eg. "CRON:Task:<CLASS_NAME_OF_THE_CURRENT_TASK>").

Introduced for the "Mail to ticket automation" extension, so we know when a Ticket is created/updated from an email.

SVN:trunk[5181]
This commit is contained in:
Guillaume Lajarige
2017-12-29 09:55:36 +00:00
parent cc6272e84a
commit 333411535e

View File

@@ -88,6 +88,7 @@ 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;
@@ -145,6 +146,8 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit)
throw $oExceptionToThrow;
}
unset($oCtx);
return $sMessage;
}