Shpigford
Shpigford

Reputation: 25348

DelayedJob: run_at seems to override priority

With DelayedJob, If there's a big backlog of jobs and the workers can't keep up to run the jobs at their specified times, it seems DJ selects the earliest run time over priority.

As you can see from the attached image, a job was locked at a time later than those run_at's but it chose the earlier run_at instead of the higher priority.

I would expect it to do the opposite.

alt text

Upvotes: 3

Views: 538

Answers (1)

DanneManne
DanneManne

Reputation: 21180

You seem to use Priority backwards. Lower numbers actually have higher priority. So it looks okay to me.

Quote from https://github.com/collectiveidea/delayed_job

By default all jobs are scheduled with priority = 0, which is top priority. You can change this by setting Delayed::Worker.default_priority to something else. Lower numbers have higher priority.

Upvotes: 3

Related Questions