mirror of
https://github.com/plashchynski/crono.git
synced 2026-11-29 19:42:38 +01:00
Add Job#save to save job info to DB
This commit is contained in:
1 parent
d0b35aaa6e
commit
c54f52a71d
3 files changed
+26
-2
No files matched your search
@@ -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