Module: Desiru::Jobs::Retriable::ClassMethods
- Defined in:
- lib/desiru/jobs/retriable.rb
Instance Method Summary collapse
-
#configure_retries(max_retries: nil, strategy: nil, retriable: nil, non_retriable: nil) ⇒ Object
DSL for configuring retry policy.
-
#retry_policy(policy = nil) ⇒ Object
Configure retry policy for the job class.
Instance Method Details
#configure_retries(max_retries: nil, strategy: nil, retriable: nil, non_retriable: nil) ⇒ Object
DSL for configuring retry policy
24 25 26 27 28 29 30 31 32 |
# File 'lib/desiru/jobs/retriable.rb', line 24 def configure_retries(max_retries: nil, strategy: nil, retriable: nil, non_retriable: nil) = {} [:max_retries] = max_retries if max_retries [:retry_strategy] = strategy if strategy [:retriable_errors] = retriable if retriable [:non_retriable_errors] = non_retriable if non_retriable @retry_policy = RetryStrategies::RetryPolicy.new(**) end |
#retry_policy(policy = nil) ⇒ Object
Configure retry policy for the job class
15 16 17 18 19 20 21 |
# File 'lib/desiru/jobs/retriable.rb', line 15 def retry_policy(policy = nil) if policy @retry_policy = policy else @retry_policy ||= RetryStrategies::RetryPolicy.new end end |