Prefer `create` over `create!` when not checking for response.

This commit is contained in:
Guo Xiang Tan 2018-09-19 18:22:54 +08:00
parent d4bd04c3a7
commit 667e68ec58
1 changed files with 1 additions and 1 deletions

View File

@ -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