mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: don't allow concurrently queued once off jobs to do work
This commit is contained in:
parent
72849e65de
commit
eda6084d4b
1 changed files with 1 additions and 0 deletions
|
@ -12,6 +12,7 @@ class Jobs::Onceoff < Jobs::Base
|
|||
if args[:force] || !OnceoffLog.where(job_name: job_name).exists?
|
||||
return if $redis.exists(self.class.name)
|
||||
DistributedMutex.synchronize(self.class.name) do
|
||||
return if OnceoffLog.where(job_name: job_name).exists? && !args[:force]
|
||||
execute_onceoff(args)
|
||||
OnceoffLog.create(job_name: job_name)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue