From 5c5c03e3e2929529811b698fb11c569fa37cb73b Mon Sep 17 00:00:00 2001 From: MarioCamaraNeto Date: Fri, 30 Apr 2021 20:17:21 -0300 Subject: [PATCH] Change ordering LIFO to FIFO. Push in left and pop from right --- src/drivers/redis/Queue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/redis/Queue.php b/src/drivers/redis/Queue.php index 994d9e865f..c170dc47e5 100644 --- a/src/drivers/redis/Queue.php +++ b/src/drivers/redis/Queue.php @@ -162,10 +162,10 @@ protected function reserve($timeout) protected function moveExpired($from) { $now = time(); - if ($expired = $this->redis->zrevrangebyscore($from, $now, '-inf')) { + if ($expired = $this->redis->zrangebyscore($from, '-inf', $now)) { $this->redis->zremrangebyscore($from, '-inf', $now); foreach ($expired as $id) { - $this->redis->rpush("$this->channel.waiting", $id); + $this->redis->lpush("$this->channel.waiting", $id); } } }