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-13 15:50:28 +02:00
parent 22f87c8826
commit 9934286a33

View file

@ -11,6 +11,13 @@ class Scheduler < ApplicationModel
Thread.abort_on_exception = true
# reconnect in case db connection is lost
begin
ActiveRecord::Base.connection.reconnect!
rescue => e
logger.error "Can't reconnect to database #{e.inspect}"
end
# cleanup old background jobs
cleanup