mirror of
https://github.com/plashchynski/crono.git
synced 2026-03-30 22:32:24 +02:00
Add Job#save to save job info to DB
This commit is contained in:
@@ -30,5 +30,14 @@ module Crono
|
||||
logger.info "Finished #{performer} in %.2f seconds" % (Time.now - last_performed_at)
|
||||
end
|
||||
end
|
||||
|
||||
def save
|
||||
model.update(last_performed_at: last_performed_at)
|
||||
end
|
||||
|
||||
private
|
||||
def model
|
||||
@model ||= Crono::CronoJob.find_or_create_by(job_id: job_id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user