Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the result after cleaning the queue to reduce stuck transaction #448

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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