mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 18:01:25 +08:00
FIX: eliminate race condition creating posts
FIX: correct message bus posting
This commit is contained in:
@ -1,6 +1,10 @@
|
||||
# Cross-process locking using Redis.
|
||||
class DistributedMutex
|
||||
|
||||
def self.synchronize(key, redis=nil, &blk)
|
||||
self.new(key, redis).synchronize(&blk)
|
||||
end
|
||||
|
||||
def initialize(key, redis=nil)
|
||||
@key = key
|
||||
@redis = redis || $redis
|
||||
|
Reference in New Issue
Block a user