Cyril Duchon-Doris
Cyril Duchon-Doris

Reputation: 13949

Set the current execution/retry number manually for a sidekiq job with ActiveJob

I have implemented retry-number dependent logic on my jobs. For example, when a job fails the first time, I restart it with additional params to handle the "clean up" of what the previous job execution may have done incorrectly.

How can I run a sidekiq job (via ActiveJob or manually) with a specific execution number

This is different than adding sidekiq_options :retry => 5 in the class definition of the job.

I need something like

MyJob.set(retry_number: 2).perform_now(*args) 

What is the syntax, or is there is a documentation that explains how to do this ?

This would prove useful

Upvotes: 1

Views: 407

Answers (0)

Related Questions