Permalink
Browse files

make queue connection more resilient to errors

  • Loading branch information...
laurencei committed Mar 11, 2018
1 parent 0df3eb8 commit 6602a84b12769edca90b6e5781bb3cb71b4894a7
Showing with 8 additions and 2 deletions.
  1. +8 −2 app/Monitors/Queue.php
@@ -199,9 +199,15 @@ public function getPendingJobsCount($queue)
return 0;
}
$qm = app(QueueManager::class)->connection($queue->connection);
try {
$qm = app(QueueManager::class)->connection($queue->connection);
return (new $driver_class($qm, $queue))->pendingJobsCount($queue->tube);
} catch (Exception $e) {
$this->eye->logger()->debug('Unable to find Queue connection', ['exception' => $e->getMessage(), 'connection' => $queue->connection]);
}
return (new $driver_class($qm, $queue))->pendingJobsCount($queue->tube);
return -1;
}
/**

0 comments on commit 6602a84

Please sign in to comment.