Clear all connections once master recovers.
This commit is contained in:
parent
c06824e9c2
commit
646ed87aba
|
@ -80,6 +80,7 @@ class PostgreSQLFallbackHandler
|
||||||
self.master_up(key)
|
self.master_up(key)
|
||||||
disable_readonly_mode
|
disable_readonly_mode
|
||||||
Sidekiq.unpause!
|
Sidekiq.unpause!
|
||||||
|
clear_connections
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
logger.warn "#{log_prefix}: Connection to master PostgreSQL server failed with '#{e.message}'"
|
logger.warn "#{log_prefix}: Connection to master PostgreSQL server failed with '#{e.message}'"
|
||||||
|
|
|
@ -36,7 +36,6 @@ describe ActiveRecord::ConnectionHandling do
|
||||||
|
|
||||||
after do
|
after do
|
||||||
postgresql_fallback_handler.setup!
|
postgresql_fallback_handler.setup!
|
||||||
postgresql_fallback_handler.clear_connections
|
|
||||||
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
Discourse.disable_readonly_mode(Discourse::PG_READONLY_MODE_KEY)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue