FIX: Avoid throwing an error when processing PG down message.

This commit is contained in:
Guo Xiang Tan 2019-01-21 11:48:54 +08:00
parent 53c0ad9388
commit cc83bc8fcf

View File

@ -18,8 +18,12 @@ class PostgreSQLFallbackHandler
MessageBus.subscribe(DATABASE_DOWN_CHANNEL) do |payload, pid|
if @initialized && pid != Process.pid
RailsMultisite::ConnectionManagement.with_connection(payload.data['db']) do
clear_connections
begin
RailsMultisite::ConnectionManagement.with_connection(payload.data['db']) do
clear_connections
end
rescue PG::UnableToSend
# Site has already failed over
end
end
end