How to set retry count for Sidekiq with ActiveJob?

后端 未结 7 2041
走了就别回头了
走了就别回头了 2021-02-07 01:50

From the Rails API, I found ActiveJob can retry_job interval:

my_job_instance.enqueue
my_job_instance.enqueue wait: 5.minutes
my_job_instance.enqueue queue: :imp         


        
7条回答
  •  独厮守ぢ
    2021-02-07 02:35

    See here the defaults for Sidekiq. The attribute retry "accepts" a boolean value and not a number as you assumed.

    From the merge of active_job into Rails this other file one can see that once again retry doesn't accept the number of retries.

    What the documentation says then is that per job you can define if the job retries or not.

    I also tried to find if the config/sidekiq.yml file can receive this number, and seems like it can't.

    Finally,

    If you don't fix the bug within 25 retries (about 21 days), Sidekiq will stop retrying and move your job to the Dead Job Queue. You can fix the bug and retry the job manually anytime within the next 6 months using the Web UI.

提交回复
热议问题