Module: RocketJob::Plugins::Job::Persistence
- Extended by:
- ActiveSupport::Concern
- Included in:
- Job
- Defined in:
- lib/rocket_job/plugins/job/persistence.rb
Overview
Prevent more than one instance of this job class from running at a time
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#reload ⇒ Object
Set in-memory job to complete if ‘destroy_on_complete` and the job has been destroyed.
Instance Method Details
#reload ⇒ Object
Set in-memory job to complete if ‘destroy_on_complete` and the job has been destroyed
101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/rocket_job/plugins/job/persistence.rb', line 101 def reload return super unless destroy_on_complete begin super rescue Mongoid::Errors::DocumentNotFound unless completed? self.state = :completed rocket_job_set_completed_at rocket_job_mark_complete end self end end |