From 2d86599a19f72e734beeb9c9707e04193e2e9fa3 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 26 Nov 2019 13:52:59 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B02519=20-=20ev=5Ftimeout=20from=20"New"?= =?UTF-8?q?=20to=20"Escalated=20TTO"=20doesn't=20work?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/ormstopwatch.class.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index 53184459f..109afaae8 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -525,10 +525,10 @@ class CheckStopWatchThresholds implements iBackgroundProcess $iPercent = $aThresholdData['percent']; // could be different than the index ! $sNow = date(AttributeDateTime::GetSQLFormat()); - $sExpression = "SELECT $sClass WHERE {$sAttCode}_laststart AND {$sAttCode}_{$iThreshold}_triggered = 0 AND {$sAttCode}_{$iThreshold}_deadline < '$sNow'"; + $sExpression = "SELECT $sClass WHERE {$sAttCode}_laststart AND {$sAttCode}_{$iThreshold}_triggered = 0 AND {$sAttCode}_{$iThreshold}_deadline < :now"; $oFilter = DBObjectSearch::FromOQL($sExpression); - $oSet = new DBObjectSet($oFilter); - $oSet->OptimizeColumnLoad(array($sAttCode)); + $oSet = new DBObjectSet($oFilter, array(), array('now' => $sNow)); + $oSet->OptimizeColumnLoad(array($sClass => array($sAttCode))); while ((time() < $iTimeLimit) && ($oObj = $oSet->Fetch())) { $sClass = get_class($oObj);