lib/message_bus/backends/redis.rb in message_bus-2.2.1 vs lib/message_bus/backends/redis.rb in message_bus-2.2.2
- old
+ new
@@ -431,13 +431,14 @@
def is_readonly?
key = "__mb_is_readonly"
begin
+ # disconnect to force a reconnect when attempting to set the key
# in case we are not connected to the correct server
# which can happen when sharing ips
- pub_redis.client.reconnect
- pub_redis.client.call([:set, key, '1'])
+ pub_redis.disconnect!
+ pub_redis.set(key, '1')
false
rescue ::Redis::CommandError => e
return true if e.message =~ /^READONLY/
end
end