Skip to content

Commit 7ff3692

Browse files
Optimize navbar (#6266)
Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent b7976f7 commit 7ff3692

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
@@ -64,7 +64,7 @@ public function push(JobInterface $job, int $delay = 0): bool
6464
return (bool) $this->redis->lPush($this->channel->getWaiting(), $data);
6565
}
6666

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

7070
public function delete(JobInterface $job): bool
@@ -153,7 +153,7 @@ protected function retry(MessageInterface $message): bool
153153

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

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

159159
protected function getRetrySeconds(int $attempts): int
@@ -174,7 +174,7 @@ protected function getRetrySeconds(int $attempts): int
174174
*/
175175
protected function remove(mixed $data): bool
176176
{
177-
return $this->redis->zrem($this->channel->getReserved(), (string) $data) > 0;
177+
return (bool) $this->redis->zrem($this->channel->getReserved(), (string) $data);
178178
}
179179

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

0 commit comments

Comments
 (0)