Prefer `create` over `create!` when not checking for response.
This commit is contained in:
parent
d4bd04c3a7
commit
667e68ec58
|
@ -19,7 +19,7 @@ class Jobs::Onceoff < Jobs::Base
|
|||
begin
|
||||
return if OnceoffLog.where(job_name: job_name).exists? && !args[:force]
|
||||
execute_onceoff(args)
|
||||
OnceoffLog.create(job_name: job_name)
|
||||
OnceoffLog.create!(job_name: job_name)
|
||||
ensure
|
||||
$redis.del(running_key_name) if has_lock
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue