Retry without failing

28 views
Skip to first unread message

Roman

unread,
Jan 22, 2018, 12:25:58 PM1/22/18
to Sidekiq
Hello,

Is it possible to schedule a retry without a failure? For example, by raising some special RetryException which gets caught by the Sidekiq?
I'd like to poll an API until the necessary data is ready, and thought I could make use of the Sidekiq's retry mechanism. Otherwise, I guess, I'd have to calculate the backoff and re-schedule the job myself?

Thanks,
Roman

Mike Perham

unread,
Jan 22, 2018, 1:23:42 PM1/22/18
to sid...@googlegroups.com
Nope, retries must be triggered by exception.  You have two options:

1. Rescue the exception in your job and reschedule another job to run in a while using perform_in using your own backoff logic.
2. Raise a custom exception to trigger Sidekiq’s retry and configure your error service to ignore that type of error.

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+unsubscribe@googlegroups.com.
To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/3f893313-4692-4cf4-b41a-94608cdb8edc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mike Perham – CEO, Contributed Systems
Smart, effective open source infrastructure for your apps.

Roman

unread,
Jan 22, 2018, 4:01:45 PM1/22/18
to Sidekiq
Thank you, option 2 sounds good.

Best,
Roman

Nope, retries must be triggered by exception.  You have two options:

1. Rescue the exception in your job and reschedule another job to run in a while using perform_in using your own backoff logic.
2. Raise a custom exception to trigger Sidekiq’s retry and configure your error service to ignore that type of error.
On Mon, Jan 22, 2018 at 9:25 AM, Roman <broil...@gmail.com> wrote:
Hello,

Is it possible to schedule a retry without a failure? For example, by raising some special RetryException which gets caught by the Sidekiq?
I'd like to poll an API until the necessary data is ready, and thought I could make use of the Sidekiq's retry mechanism. Otherwise, I guess, I'd have to calculate the backoff and re-schedule the job myself?

Thanks,
Roman

--
You received this message because you are subscribed to the Google Groups "Sidekiq" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sidekiq+u...@googlegroups.com.

To post to this group, send email to sid...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sidekiq/3f893313-4692-4cf4-b41a-94608cdb8edc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages