Exception: Amigo::Retry::Retry
- Defined in:
- lib/amigo/retry.rb
Overview
Raise this class, or a subclass of it, to schedule a later retry, rather than using an error to trigger Sidekiq’s default retry behavior. The benefit here is that it allows a consistent, customizable behavior, so is better for ‘expected’ errors like rate limiting.
Instance Attribute Summary collapse
-
#interval_or_timestamp ⇒ Object
Returns the value of attribute interval_or_timestamp.
-
#wrapped ⇒ Object
Returns the value of attribute wrapped.
Instance Method Summary collapse
-
#initialize(interval_or_timestamp, msg = nil) ⇒ Retry
constructor
A new instance of Retry.
Constructor Details
#initialize(interval_or_timestamp, msg = nil) ⇒ Retry
Returns a new instance of Retry.
39 40 41 42 43 |
# File 'lib/amigo/retry.rb', line 39 def initialize(, msg=nil) = @wrapped = exc?(msg) super(exc_or_msg("retry job in #{interval_or_timestamp.to_i}s", msg)) end |
Instance Attribute Details
#interval_or_timestamp ⇒ Object
Returns the value of attribute interval_or_timestamp.
37 38 39 |
# File 'lib/amigo/retry.rb', line 37 def end |
#wrapped ⇒ Object
Returns the value of attribute wrapped.
37 38 39 |
# File 'lib/amigo/retry.rb', line 37 def wrapped @wrapped end |