Or is there a config somewhere which would accept number of retries. Any inputs would be appreciated. I saw this link Restart failed jobs of a specific worker in resque and have an idea on how to retry jobs manually. I am looking for making this step automated.
Asked
Active
Viewed 2,705 times
2 Answers
0
You can use resque failure hooks which is called whenever is job is failed.
You can either override this method or use some plugin to do so.
once jobs is failed log and retry it from here only.
Code from resque code base, file: resque-1.27.1/lib/resque/job.rb
# Given an exception object, hands off the needed parameters to
# the Failure module.
def fail(exception)
begin
run_failure_hooks(exception)
rescue Exception => e
raise e
ensure
Failure.create \
:payload => payload,
:exception => exception,
:worker => worker,
:queue => queue
end
end

ritzz.soni
- 335
- 1
- 15
0
No, Resque doesn't have a built-in retry functionality.
You can use the plugin resque-retry
or if you're already using ActiveJob with Resque you can use the native retry_on
feature.
Note that resque-retry
doesn't seem to work with ActiveJob so it's either-or.

thisismydesign
- 21,553
- 9
- 123
- 126