JoobQ::ExponentialBackoff
Inherits Reference < Object
Constants
ACQUIRE_RETRY_LOCK = " if redis.call('GET', KEYS[1]) == ARGV[1] then return 0 end\n redis.call('SET', KEYS[1], ARGV[1], 'EX', ARGV[2])\n return 1"
Takes the retry lock for one failure of a job: the lock holds the attempt that failed, so a second handler of that same failure finds it and backs off, while the job's next failure (another attempt) replaces it. The lock is still there when the retry it guarded runs and fails again: keyed by the job alone, that failure was skipped and the job lost. One key per job, so every place that clears it still does.
Class methods
Clean up retry lock when job completes successfully
Move job from processing to dead letter queue Returns the modified job with dead status
retry_idempotent(job : JoobQ::Job, queue : BaseQueue, retry_attempt : Int32) : Tuple(Bool, JoobQ::Job)
Idempotent retry: schedules each failure of a job once, however many handlers see that failure Returns a tuple of (success: Bool, modified_job: Job)