mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
DEV: Fix publish to message_bus when forcing pg readonly.
This commit is contained in:
parent
389bdcf5ab
commit
32735be5bd
@ -18,10 +18,15 @@ if ENV["ACTIVE_RECORD_RAILS_FAILOVER"]
|
||||
|
||||
def self.enable_pg_force_readonly_mode
|
||||
Discourse.redis.set(PG_FORCE_READONLY_MODE_KEY, 1)
|
||||
MessageBus.publish(readonly_channel, true)
|
||||
Site.clear_anon_cache!
|
||||
true
|
||||
end
|
||||
|
||||
def self.disable_pg_force_readonly_mode
|
||||
Discourse.redis.del(PG_FORCE_READONLY_MODE_KEY)
|
||||
result = Discourse.redis.del(PG_FORCE_READONLY_MODE_KEY)
|
||||
MessageBus.publish(readonly_channel, false)
|
||||
result > 0
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user