mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 02:16:10 +08:00
DEV: Force ActiveRecord reading role on Redis failover take 2.
This commit is contained in:
parent
5adf2ccaca
commit
383537a2fa
@ -56,8 +56,8 @@ if defined?(RailsFailover::ActiveRecord)
|
||||
Discourse::PG_READONLY_MODE_KEY,
|
||||
Discourse::PG_FORCE_READONLY_MODE_KEY
|
||||
) || (
|
||||
GlobalSetting.redis_config[:replica_port] &&
|
||||
Discourse.redis.connection[:port] == GlobalSetting.redis_config[:replica_port]
|
||||
GlobalSetting.redis_config[:replica_host] &&
|
||||
Discourse.redis.connection[:host] == GlobalSetting.redis_config[:replica_host]
|
||||
)
|
||||
rescue => e
|
||||
if e.is_a?(Redis::CannotConnectError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user