The requeue option needs to be a worker level configurable option. Right now with these following two lines, all jobs that fail will never be rescheduled.
|
ch.basic_reject(msg.delivery_tag, requeue: false) |
|
ch.basic_reject(msg.delivery_tag, requeue: false) |
The worker itself should have an option to set a maximum count for this. For example, something like this:
class MyWorker < TJLavin::QueuedJob
def rescheduleable?(retry_count : Int32 = 0) : Bool
retry_count <= 3
end
end
The rescheduleable method should be overriden from the TJLavin::QueuedJob class where the default is always false.
The requeue option needs to be a worker level configurable option. Right now with these following two lines, all jobs that fail will never be rescheduled.
tj_lavin/src/tj_lavin/runner.cr
Line 33 in 9e8c0d3
tj_lavin/src/tj_lavin/runner.cr
Line 41 in 9e8c0d3
The worker itself should have an option to set a maximum count for this. For example, something like this:
The
rescheduleablemethod should be overriden from theTJLavin::QueuedJobclass where the default is always false.