Class: Exekutor::Job
- Inherits:
-
Internal::BaseRecord
- Object
- Internal::BaseRecord
- Exekutor::Job
- Defined in:
- lib/exekutor/job.rb
Overview
Active record instance for a job
Instance Method Summary collapse
-
#discard! ⇒ Object
Sets the status to discarded.
-
#release! ⇒ Object
Sets the status to pending and clears the assigned worker.
-
#reschedule!(at: Time.current) ⇒ Object
Sets the status to pending, clears the assigned worker, and schedules execution at the indicated time.
Instance Method Details
#discard! ⇒ Object
Sets the status to discarded.
27 28 29 |
# File 'lib/exekutor/job.rb', line 27 def discard! update! status: "d" end |
#release! ⇒ Object
Sets the status to pending and clears the assigned worker
16 17 18 |
# File 'lib/exekutor/job.rb', line 16 def release! update! status: "p", worker_id: nil end |
#reschedule!(at: Time.current) ⇒ Object
Sets the status to pending, clears the assigned worker, and schedules execution at the indicated time.
22 23 24 |
# File 'lib/exekutor/job.rb', line 22 def reschedule!(at: Time.current) update! status: "p", scheduled_at: at, worker_id: nil, runtime: nil end |