Class: Jobs::WatchChildJobs
- Defined in:
- lib/jobs/watch_child_jobs.rb
Instance Method Summary collapse
Methods included from Que::BackgroundJobLogger
Methods included from Que::SetApplicationNameWhenJobRuns
#_run, #get_application_name_when_job_runs, #set_application_name_when_job_runs
Instance Method Details
#run(options) ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'lib/jobs/watch_child_jobs.rb', line 3 def run() unless QueJob.where(parent_job_id: [:job_id]).count > 0 QueJobStatus.where(job_id: [:job_id]).update_all(finished_at: Time.now, status: 'finished') return end self.class.enqueue(.merge(run_at: Time.current + 1.second)) end |