Class: Sbmt::Outbox::RetryStrategies::ExponentialBackoff
- Inherits:
-
DryInteractor
- Object
- DryInteractor
- Sbmt::Outbox::RetryStrategies::ExponentialBackoff
- Defined in:
- app/interactors/sbmt/outbox/retry_strategies/exponential_backoff.rb
Instance Method Summary collapse
Methods inherited from DryInteractor
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/interactors/sbmt/outbox/retry_strategies/exponential_backoff.rb', line 9 def call delay = backoff(outbox_item.config).interval_at(outbox_item.errors_count - 1) still_early = outbox_item.processed_at + delay.seconds > Time.current if still_early Failure(:skip_processing) else Success() end end |