mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user