diff --git a/src/Driver/RedisDriver.php b/src/Driver/RedisDriver.php index dd71403..f5cffdc 100644 --- a/src/Driver/RedisDriver.php +++ b/src/Driver/RedisDriver.php @@ -63,7 +63,7 @@ public function push(JobInterface $job, int $delay = 0): bool return (bool) $this->redis->lPush($this->channel->getWaiting(), $data); } - return $this->redis->zAdd($this->channel->getDelayed(), time() + $delay, $data) > 0; + return (bool) $this->redis->zAdd($this->channel->getDelayed(), time() + $delay, $data); } public function delete(JobInterface $job): bool @@ -152,7 +152,7 @@ protected function retry(MessageInterface $message): bool $delay = time() + $this->getRetrySeconds($message->getAttempts()); - return $this->redis->zAdd($this->channel->getDelayed(), $delay, $data) > 0; + return (bool) $this->redis->zAdd($this->channel->getDelayed(), $delay, $data); } protected function getRetrySeconds(int $attempts): int @@ -173,7 +173,7 @@ protected function getRetrySeconds(int $attempts): int */ protected function remove(mixed $data): bool { - return $this->redis->zrem($this->channel->getReserved(), (string) $data) > 0; + return (bool) $this->redis->zrem($this->channel->getReserved(), (string) $data); } /** @@ -185,7 +185,7 @@ protected function move(string $from, string $to): void $options = ['LIMIT' => [0, 100]]; if ($expired = $this->redis->zrevrangebyscore($from, (string) $now, '-inf', $options)) { foreach ($expired as $job) { - if ($this->redis->zRem($from, $job) > 0) { + if ($this->redis->zRem($from, $job)) { $this->redis->lPush($to, $job); } }