Skip to content

Commit

Permalink
refactor: fix variable types in RedisHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Dec 16, 2023
1 parent 5768cf9 commit a917ff0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Handlers/RedisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function later(QueueJob $queueJob, int $seconds): bool
$queueJob->available_at = Time::now()->addSeconds($seconds)->timestamp;

if ($result = (int) $this->redis->zAdd("queues:{$queueJob->queue}:{$queueJob->priority}", $queueJob->available_at->timestamp, json_encode($queueJob))) {
$this->redis->hDel("queues:{$queueJob->queue}::reserved", $queueJob->id);
$this->redis->hDel("queues:{$queueJob->queue}::reserved", (string) $queueJob->id);
}

return $result > 0;
Expand All @@ -130,7 +130,7 @@ public function failed(QueueJob $queueJob, Throwable $err, bool $keepJob): bool
$this->logFailed($queueJob, $err);
}

return (bool) $this->redis->hDel("queues:{$queueJob->queue}::reserved", $queueJob->id);
return (bool) $this->redis->hDel("queues:{$queueJob->queue}::reserved", (string) $queueJob->id);
}

/**
Expand All @@ -145,7 +145,7 @@ public function done(QueueJob $queueJob, bool $keepJob): bool
$this->redis->lPush("queues:{$queueJob->queue}::done", json_encode($queueJob));
}

return (bool) $this->redis->hDel("queues:{$queueJob->queue}::reserved", $queueJob->id);
return (bool) $this->redis->hDel("queues:{$queueJob->queue}::reserved", (string) $queueJob->id);
}

/**
Expand Down

0 comments on commit a917ff0

Please sign in to comment.