Class: Sbmt::Outbox::RetryStrategies::ExponentialBackoff
- Inherits:
-
Base
- Object
- DryInteractor
- Base
- 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
7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/interactors/sbmt/outbox/retry_strategies/exponential_backoff.rb', line 7 def call delay = backoff(item.config).interval_at(item.errors_count - 1) still_early = item.processed_at + delay.seconds > Time.current if still_early Failure(:skip_processing) else Success() end end |