Class: Forked::RetryStrategies::Always
- Inherits:
-
Object
- Object
- Forked::RetryStrategies::Always
- Defined in:
- lib/forked/retry_strategies/always.rb
Overview
Relies on the master restarting the worker process
Instance Method Summary collapse
-
#initialize(logger:, on_error:) ⇒ Always
constructor
A new instance of Always.
- #run(ready_to_stop, &block) ⇒ Object
Constructor Details
#initialize(logger:, on_error:) ⇒ Always
Returns a new instance of Always.
5 6 7 8 |
# File 'lib/forked/retry_strategies/always.rb', line 5 def initialize(logger:, on_error:) @logger = logger @on_error = on_error end |
Instance Method Details
#run(ready_to_stop, &block) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/forked/retry_strategies/always.rb', line 10 def run(ready_to_stop, &block) block.call rescue => e @logger.error("#{e.class} #{e.message}") @on_error.call(e, 1) raise end |