mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 05:01:13 +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_READONLY_MODE_KEY,
|
||||||
Discourse::PG_FORCE_READONLY_MODE_KEY
|
Discourse::PG_FORCE_READONLY_MODE_KEY
|
||||||
) || (
|
) || (
|
||||||
GlobalSetting.redis_config[:replica_port] &&
|
GlobalSetting.redis_config[:replica_host] &&
|
||||||
Discourse.redis.connection[:port] == GlobalSetting.redis_config[:replica_port]
|
Discourse.redis.connection[:host] == GlobalSetting.redis_config[:replica_host]
|
||||||
)
|
)
|
||||||
rescue => e
|
rescue => e
|
||||||
if e.is_a?(Redis::CannotConnectError)
|
if e.is_a?(Redis::CannotConnectError)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user