Delos Chang
Delos Chang

Reputation: 1853

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?

Upvotes: 2

Views: 374

Answers (1)

usha
usha

Reputation: 29349

You can actually do this

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

Documentation here

Upvotes: 4

Related Questions