Skip to content

Commit

Permalink
Show the time it takes before the queue is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
arjanwestdorp committed Feb 13, 2021
1 parent 9cbe57f commit 96b177d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Repositories/RedisWorkloadRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 96b177d

Please sign in to comment.