mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
FIX: Avoid throwing an error when processing PG down message.
This commit is contained in:
parent
53c0ad9388
commit
cc83bc8fcf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user