Yup, will get these fixed when I get the chance to. Thanks for pointing
these out.

Sent from my phone

On Apr 24, 2013, at 7:30 PM, Vincent Driessen <notifications@github.com>
wrote:

In rq/queue.py:

> @@ -188,6 +200,16 @@ def enqueue_job(self, job, timeout=None, set_meta_data=True):
>              job.save()
>          return job
>
> +    def enqueue_waitlist(self, job):
> +        """Enqueues all jobs in the waitlist and clears it"""
> +        # TODO: can probably be pipelined
> +        job_ids = job.get_waitlist()
> +        for job_id in job.get_waitlist():
> +            waitlisted_job = Job.fetch(job_id, connection=self.connection)
> +            self.enqueue_job(waitlisted_job)
> +        if job_ids:

Here's another race condition. If, right at this point, a new job is added
to the waitlist, it will be cleared and never get executed.

—
Reply to this email directly or view it on
GitHub<https://github.com/nvie/rq/pull/207/files#r3935455>
.