mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-25 06:11:20 -04:00
FIX: Pubsub connections need to be killed too.
This commit is contained in:
parent
d6ed9848a9
commit
7f6fe8fe13
2 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,7 @@ class DiscourseRedis
|
|||
if slave_client.call([:info]).split("\r\n").include?(MASTER_LINK_STATUS)
|
||||
logger.warn "#{log_prefix}: Master server is active, killing all connections to slave..."
|
||||
slave_client.call([:client, [:kill, 'type', 'normal']])
|
||||
slave_client.call([:client, [:kill, 'type', 'pubsub']])
|
||||
Discourse.clear_readonly!
|
||||
Discourse.request_refresh!
|
||||
@master = true
|
||||
|
|
|
@ -84,6 +84,7 @@ describe DiscourseRedis do
|
|||
fallback_handler.master = false
|
||||
Redis::Client.any_instance.expects(:call).with([:info]).returns(DiscourseRedis::FallbackHandler::MASTER_LINK_STATUS)
|
||||
Redis::Client.any_instance.expects(:call).with([:client, [:kill, 'type', 'normal']])
|
||||
Redis::Client.any_instance.expects(:call).with([:client, [:kill, 'type', 'pubsub']])
|
||||
|
||||
fallback_handler.initiate_fallback_to_master
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue