FIX: Set master to true before forcing slave connections to reconnect.
This commit is contained in:
parent
02025207d5
commit
dd4cab3be2
|
@ -35,13 +35,14 @@ class DiscourseRedis
|
||||||
if slave_client.call([:info]).split("\r\n").include?(MASTER_LINK_STATUS)
|
if slave_client.call([:info]).split("\r\n").include?(MASTER_LINK_STATUS)
|
||||||
logger.info "#{log_prefix}: Master server is active, killing all connections to slave..."
|
logger.info "#{log_prefix}: Master server is active, killing all connections to slave..."
|
||||||
|
|
||||||
|
self.master = true
|
||||||
|
|
||||||
CONNECTION_TYPES.each do |connection_type|
|
CONNECTION_TYPES.each do |connection_type|
|
||||||
slave_client.call([:client, [:kill, 'type', connection_type]])
|
slave_client.call([:client, [:kill, 'type', connection_type]])
|
||||||
end
|
end
|
||||||
|
|
||||||
Discourse.clear_readonly!
|
Discourse.clear_readonly!
|
||||||
Discourse.request_refresh!
|
Discourse.request_refresh!
|
||||||
self.master = true
|
|
||||||
success = true
|
success = true
|
||||||
end
|
end
|
||||||
ensure
|
ensure
|
||||||
|
|
Loading…
Reference in New Issue