From 96b177db2068289a6fdc8d28198ee1c24ee8b8c2 Mon Sep 17 00:00:00 2001 From: Arjan Date: Sat, 13 Feb 2021 21:20:38 +0100 Subject: [PATCH] Show the time it takes before the queue is empty --- src/Repositories/RedisWorkloadRepository.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Repositories/RedisWorkloadRepository.php b/src/Repositories/RedisWorkloadRepository.php index f49ff361..38b91758 100644 --- a/src/Repositories/RedisWorkloadRepository.php +++ b/src/Repositories/RedisWorkloadRepository.php @@ -77,11 +77,11 @@ public function get() return [$queueName => $this->queue->connection($connection)->readyNow($queueName)]; }); - $splitQueues = Str::contains($queue, ',') ? $length->map(function ($length, $queueName) use ($connection, $totalProcesses) { + $splitQueues = Str::contains($queue, ',') ? $length->map(function ($length, $queueName) use ($connection, $totalProcesses, &$wait) { return [ 'name' => $queueName, 'length' => $length, - 'wait' => $this->waitTime->calculateTimeToClear($connection, $queueName, $totalProcesses), + 'wait' => $wait += $this->waitTime->calculateTimeToClear($connection, $queueName, $totalProcesses), ]; }) : null;