Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RB387 committed Nov 26, 2024
1 parent 8a700f7 commit aaa9585
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ async def start_jobs(self, job_ids: List[bytes]) -> None:
score = await pipe.zscore(self.queue_name, job_id)
if ongoing_exists or not score or score > timestamp_ms():
# job already started elsewhere, or already finished and removed from queue
# if score > ts_now,
# it means probably the job was re-enqueued with a delay in another worker
self.job_counter = self.job_counter - 1
self.sem.release()
logger.debug('job %s already running elsewhere', job_id)
Expand Down

0 comments on commit aaa9585

Please sign in to comment.