DEV: Only failover the entire cluster when the default db goes down.
This commit is contained in:
parent
31e31ef449
commit
d5c56a846a
|
@ -31,9 +31,11 @@ if defined?(RailsFailover::ActiveRecord)
|
|||
end
|
||||
|
||||
RailsFailover::ActiveRecord.on_failover do
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
|
||||
if RailsMultisite::ConnectionManagement.current_db = RailsMultisite::ConnectionManagement::DEFAULT
|
||||
RailsMultisite::ConnectionManagement.each_connection do
|
||||
Discourse.enable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||
Sidekiq.pause!("pg_failover") if !Sidekiq.paused?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue