From: Tim Otten Date: Tue, 17 Jan 2023 03:00:41 +0000 (-0800) Subject: CRM_Queue_Queue_SqlTrait - Prefer operations using Unix epoch format X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d4ef7d8b8abd34a92c70b0097c358e1e94bde0b5;p=civicrm-core.git CRM_Queue_Queue_SqlTrait - Prefer operations using Unix epoch format --- diff --git a/CRM/Queue/Queue/SqlTrait.php b/CRM/Queue/Queue/SqlTrait.php index 69f5cf2206..8fc9275e51 100644 --- a/CRM/Queue/Queue/SqlTrait.php +++ b/CRM/Queue/Queue/SqlTrait.php @@ -59,12 +59,12 @@ trait CRM_Queue_Queue_SqlTrait { switch ($name) { case 'ready': return (int) CRM_Core_DAO::singleValueQuery( - 'SELECT count(*) FROM civicrm_queue_item WHERE queue_name = %1 AND (release_time is null OR release_time <= FROM_UNIXTIME(%2))', + 'SELECT count(*) FROM civicrm_queue_item WHERE queue_name = %1 AND (release_time is null OR UNIX_TIMESTAMP(release_time) <= %2)', [1 => [$this->getName(), 'String'], 2 => [CRM_Utils_Time::time(), 'Int']]); case 'blocked': return (int) CRM_Core_DAO::singleValueQuery( - 'SELECT count(*) FROM civicrm_queue_item WHERE queue_name = %1 AND release_time > FROM_UNIXTIME(%2)', + 'SELECT count(*) FROM civicrm_queue_item WHERE queue_name = %1 AND UNIX_TIMESTAMP(release_time) > %2', [1 => [$this->getName(), 'String'], 2 => [CRM_Utils_Time::time(), 'Int']]); case 'total':