collectiveidea/delayed_job — pull request #386 by pauldoerwald (2012-04-16 20:34:11+00:00)
Title: Errored jobs retry immediately in batches of two

I created a ticket at https://github.com/collectiveidea/delayed_job/issues/385 which refers to the problem and solution (incorrectly resolved) at https://github.com/collectiveidea/delayed_job/issues/63.

The problem, in a nutshell, is that attempts 1 and 2 happen immediately following one another, then 3 and 4, then 5 and 6, etc., rather than being correctly spaced out. The reason is because the job record is not reloaded from the database and therefore has an inconsistent lock time. The solution is to reload the job before trying to run it.