mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Avoid throwing an error when processing PG down message.
This commit is contained in:
@@ -18,8 +18,12 @@ class PostgreSQLFallbackHandler
|
|||||||
|
|
||||||
MessageBus.subscribe(DATABASE_DOWN_CHANNEL) do |payload, pid|
|
MessageBus.subscribe(DATABASE_DOWN_CHANNEL) do |payload, pid|
|
||||||
if @initialized && pid != Process.pid
|
if @initialized && pid != Process.pid
|
||||||
RailsMultisite::ConnectionManagement.with_connection(payload.data['db']) do
|
begin
|
||||||
clear_connections
|
RailsMultisite::ConnectionManagement.with_connection(payload.data['db']) do
|
||||||
|
clear_connections
|
||||||
|
end
|
||||||
|
rescue PG::UnableToSend
|
||||||
|
# Site has already failed over
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user