diff --git a/CRM/Core/BAO/UserJob.php b/CRM/Core/BAO/UserJob.php index 0f1c6835002b..f0a650b9fb3c 100644 --- a/CRM/Core/BAO/UserJob.php +++ b/CRM/Core/BAO/UserJob.php @@ -38,7 +38,7 @@ public static function on_civi_queue_check(\Civi\Core\Event\GenericHookEvent $e) /** @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'); } }