DEV: Missing readonly mode banner when forcing PG readonly.
This commit is contained in:
parent
27ad562ff5
commit
2c3ff3e524
|
@ -13,6 +13,16 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
|||
|
||||
module Discourse
|
||||
PG_FORCE_READONLY_MODE_KEY ||= 'readonly_mode:postgres_force'
|
||||
|
||||
READONLY_KEYS.push(PG_FORCE_READONLY_MODE_KEY)
|
||||
|
||||
def self.enable_pg_force_readonly_mode
|
||||
Discourse.redis.set(PG_FORCE_READONLY_MODE_KEY, 1)
|
||||
end
|
||||
|
||||
def self.disable_pg_force_readonly_mode
|
||||
Discourse.redis.del(PG_FORCE_READONLY_MODE_KEY)
|
||||
end
|
||||
end
|
||||
|
||||
RailsFailover::ActiveRecord.register_force_reading_role_callback do
|
||||
|
|
Loading…
Reference in New Issue