FIX: eliminate race condition creating posts

FIX: correct message bus posting
This commit is contained in:
Sam
2014-07-30 14:04:27 +10:00
parent e7e70d14da
commit 9147af1d62
2 changed files with 24 additions and 4 deletions

View File

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