Skip to content

Commit 434943e

Browse files
committed
Merge branch 'master' into 3.1
# Conflicts: # src/support/tests/FunctionTest.php
2 parents a03ea95 + 7ff3692 commit 434943e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Driver/RedisDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function push(JobInterface $job, int $delay = 0): bool
6363
return (bool) $this->redis->lPush($this->channel->getWaiting(), $data);
6464
}
6565

66-
return $this->redis->zAdd($this->channel->getDelayed(), time() + $delay, $data) > 0;
66+
return (bool) $this->redis->zAdd($this->channel->getDelayed(), time() + $delay, $data);
6767
}
6868

6969
public function delete(JobInterface $job): bool
@@ -152,7 +152,7 @@ protected function retry(MessageInterface $message): bool
152152

153153
$delay = time() + $this->getRetrySeconds($message->getAttempts());
154154

155-
return $this->redis->zAdd($this->channel->getDelayed(), $delay, $data) > 0;
155+
return (bool) $this->redis->zAdd($this->channel->getDelayed(), $delay, $data);
156156
}
157157

158158
protected function getRetrySeconds(int $attempts): int
@@ -173,7 +173,7 @@ protected function getRetrySeconds(int $attempts): int
173173
*/
174174
protected function remove(mixed $data): bool
175175
{
176-
return $this->redis->zrem($this->channel->getReserved(), (string) $data) > 0;
176+
return (bool) $this->redis->zrem($this->channel->getReserved(), (string) $data);
177177
}
178178

179179
/**
@@ -185,7 +185,7 @@ protected function move(string $from, string $to): void
185185
$options = ['LIMIT' => [0, 100]];
186186
if ($expired = $this->redis->zrevrangebyscore($from, (string) $now, '-inf', $options)) {
187187
foreach ($expired as $job) {
188-
if ($this->redis->zRem($from, $job) > 0) {
188+
if ($this->redis->zRem($from, $job)) {
189189
$this->redis->lPush($to, $job);
190190
}
191191
}

0 commit comments

Comments
 (0)