Exception: Amigo::Retry::Retry

Inherits:
Error
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(interval_or_timestamp, msg = nil) ⇒ Retry

Returns a new instance of Retry.



29
30
31
32
# File 'lib/amigo/retry.rb', line 29

def initialize(interval_or_timestamp, msg=nil)
  @interval_or_timestamp = interval_or_timestamp
  super(msg || "retry job in #{interval_or_timestamp}")
end

Instance Attribute Details

#interval_or_timestampObject

Returns the value of attribute interval_or_timestamp.



27
28
29
# File 'lib/amigo/retry.rb', line 27

def interval_or_timestamp
  @interval_or_timestamp
end