Added temporary workaround for issue #2343 - Lost DB connection causes jobs to not be processed anymore.
This commit is contained in:
parent
5796f78c4f
commit
db9e2800a8
1 changed files with 10 additions and 0 deletions
10
config/initializers/delayed_jobs_verify_db_connection.rb
Normal file
10
config/initializers/delayed_jobs_verify_db_connection.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
require 'delayed_job'
|
||||||
|
|
||||||
|
module Delayed
|
||||||
|
class Job < ::ActiveRecord::Base
|
||||||
|
|
||||||
|
def self.recover_from(_error)
|
||||||
|
::ActiveRecord::Base.connection.verify!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue