Search code examples
ruby-on-rails-3sidekiq

Sidekiq no retries on class method


I'm calling the Sidekiq delay on a class method like:

Class.delay.some_method()

This works well except when there are errors because I cannot set the retries to false. Any advice on this?

The documentation shows retries for non-class methods (worker): https://github.com/mperham/sidekiq/wiki/Error-Handling

How do I set the retries to false for a class method without needing to convert it to a worker?


Solution

  • You can actually do this

    Class.delay(:retry => false).some_method()
    

    Documentation here