mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 03:22:46 +08:00
FIX: don't allow concurrently queued once off jobs to do work
This commit is contained in:
parent
72849e65de
commit
eda6084d4b
|
@ -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 New Issue
Block a user