rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.45k stars 229 forks source link

Use a transaction when enqueuing a job to ensure atomicity #222

Closed marianstefi20 closed 4 years ago

marianstefi20 commented 4 years ago

There are cases when the scheduler receives a SIGKILL between the zrem and zadd from enqueue_job(). This would, in turn, lead to occasional unscheduling of the repeatable jobs.

The solution I propose is to put everything in an atomic transaction and thus assure atomicity.