(REF) UserJob - Switch numberOfItems to getStatistic()
authorTim Otten <totten@civicrm.org>
Sat, 3 Sep 2022 05:16:39 +0000 (22:16 -0700)
committerTim Otten <totten@civicrm.org>
Sat, 3 Sep 2022 05:16:39 +0000 (22:16 -0700)
CRM/Core/BAO/UserJob.php

index 0f1c6835002b0557d9710e4674b951b1a937c563..f0a650b9fb3c1e1529a39d55b9f95f86e9b694f0 100644 (file)
@@ -38,7 +38,7 @@ class CRM_Core_BAO_UserJob extends CRM_Core_DAO_UserJob implements \Civi\Core\Ho
     /** @var \CRM_Queue_Queue $queue */
     $queue = $e->queue;
     $userJobId = static::findUserJobId($queue->getName());
-    if ($userJobId && $queue->numberOfItems() < 1) {
+    if ($userJobId && $queue->getStatistic('total') < 1) {
       $queue->setStatus('completed');
     }
   }