From 5df7c8bb073771b4a910007bf85e03e692a6b1eb Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 26 Aug 2020 16:12:22 +0200 Subject: [PATCH] Add Async tasks info --- webservices/cron.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/webservices/cron.php b/webservices/cron.php index 7c6d8bd36..8bda11cc3 100644 --- a/webservices/cron.php +++ b/webservices/cron.php @@ -110,22 +110,21 @@ function RunTask(BackgroundTask $oTask, $iTimeLimit) $oTask->Set('running', 1); $oTask->DBUpdate(); // Compute allowed time - if (!$oRefClass->implementsInterface('iScheduledProcess')) + if ($oRefClass->implementsInterface('iScheduledProcess')) { - // Periodic task, allow only 10x the period - $iCurrTimeLimit = time() + $oProcess->GetPeriodicity() * 10; + $iCurrTimeLimit = $iTimeLimit; + } + else + { + // Periodic task, allow only 3x the period + $iCurrTimeLimit = time() + $oProcess->GetPeriodicity() * 3; if ($iCurrTimeLimit > $iTimeLimit) { $iCurrTimeLimit = $iTimeLimit; } } - else - { - $iCurrTimeLimit = $iTimeLimit; - } $sMessage = $oProcess->Process($iCurrTimeLimit); $oTask->Set('running', 0); - } catch (MySQLHasGoneAwayException $e) {