Class: Cloudtasker::UniqueJob::ConflictStrategy::Reschedule
- Inherits:
-
BaseStrategy
- Object
- BaseStrategy
- Cloudtasker::UniqueJob::ConflictStrategy::Reschedule
- Defined in:
- lib/cloudtasker/unique_job/conflict_strategy/reschedule.rb
Overview
This strategy reschedules the job on conflict. This strategy can only be used with processing locks (e.g. while_executing).
Constant Summary collapse
- RESCHEDULE_DELAY =
seconds
5
Instance Attribute Summary
Attributes inherited from BaseStrategy
Instance Method Summary collapse
-
#on_execute ⇒ Object
Reschedule the job.
-
#on_schedule ⇒ Object
A conflict on schedule means that this strategy is being used with a lock scheduling strategy (e.g. until_executed) instead of a processing strategy (e.g. while_executing).
Methods inherited from BaseStrategy
Constructor Details
This class inherits a constructor from Cloudtasker::UniqueJob::ConflictStrategy::BaseStrategy
Instance Method Details
#on_execute ⇒ Object
Reschedule the job.
24 25 26 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/reschedule.rb', line 24 def on_execute job.worker.reenqueue(RESCHEDULE_DELAY) end |
#on_schedule ⇒ Object
A conflict on schedule means that this strategy is being used with a lock scheduling strategy (e.g. until_executed) instead of a processing strategy (e.g. while_executing). In this case we let the scheduling happen as it does not make sense to reschedule in this context.
17 18 19 |
# File 'lib/cloudtasker/unique_job/conflict_strategy/reschedule.rb', line 17 def on_schedule yield end |