Skip to content

Commit

Permalink
set the result after cleaning the queue to reduce stuck transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
isra17 committed Apr 25, 2024
1 parent 9d7944b commit 8df6e1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,12 +691,12 @@ async def finish_job(
tr.pexpire(in_progress_key, to_ms(keep_in_progress))

if finish:
if result_data:
expire = None if keep_result_forever else result_timeout_s
tr.set(result_key_prefix + job_id, result_data, px=to_ms(expire))
delete_keys += [retry_key_prefix + job_id, job_key_prefix + job_id]
tr.zrem(abort_jobs_ss, job_id)
tr.zrem(self.queue_name, job_id)
if result_data:
expire = None if keep_result_forever else result_timeout_s
tr.set(result_key_prefix + job_id, result_data, px=to_ms(expire))
elif incr_score:
tr.zincrby(self.queue_name, incr_score, job_id)
if delete_keys:
Expand Down

0 comments on commit 8df6e1a

Please sign in to comment.