Follow up: Fixed issue #1080 - Scheduler won't start because of missing DB connection on PostgreSQL 9.2.18.

This commit is contained in:
Thorsten Eckel 2017-05-15 13:02:19 +02:00
parent d5161405c0
commit 4a12788e04

View file

@ -12,8 +12,10 @@ class Scheduler < ApplicationModel
Thread.abort_on_exception = true
# reconnect in case db connection is lost
# See issue #1080
begin
ActiveRecord::Base.connection.reconnect!
rescue PG::UnableToSend => e # rubocop:disable Lint/HandleExceptions
rescue => e
logger.error "Can't reconnect to database #{e.inspect}"
end