mirror of
https://github.com/discourse/discourse.git
synced 2025-03-24 21:46:39 +08:00
DEV: Force ActiveRecord reading role on Redis failover.
This commit is contained in:
parent
7f05720e91
commit
5adf2ccaca
@ -55,6 +55,9 @@ if defined?(RailsFailover::ActiveRecord)
|
||||
Discourse.redis.exists?(
|
||||
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]
|
||||
)
|
||||
rescue => e
|
||||
if e.is_a?(Redis::CannotConnectError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user