Don't blow up if Redis switches to READONLY

This commit is contained in:
Robin Ward
2015-04-24 13:10:43 -04:00
parent 8129cce104
commit 5b3f99aa50
56 changed files with 194 additions and 147 deletions

View File

@ -51,7 +51,7 @@ class DistributedCache
return if @subscribed
@lock.synchronize do
return if @subscribed
MessageBus.subscribe(channel_name) do |message|
DiscourseBus.subscribe(channel_name) do |message|
@lock.synchronize do
process_message(message)
end
@ -63,7 +63,7 @@ class DistributedCache
def self.publish(hash, message)
message[:origin] = hash.object_id
message[:hash_key] = hash.key
MessageBus.publish(channel_name, message, { user_ids: [-1] })
DiscourseBus.publish(channel_name, message, { user_ids: [-1] })
end
def self.set(hash, key, value)