Fixed issue #1080 - Scheduler won't start because of missing DB connection on PostgreSQL 9.2.18.
This commit is contained in:
parent
22f87c8826
commit
9934286a33
1 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,13 @@ class Scheduler < ApplicationModel
|
||||||
|
|
||||||
Thread.abort_on_exception = true
|
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 old background jobs
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue