diff --git a/config/initializers/delayed_jobs_verify_db_connection.rb b/config/initializers/delayed_jobs_verify_db_connection.rb new file mode 100644 index 000000000..87d7a4527 --- /dev/null +++ b/config/initializers/delayed_jobs_verify_db_connection.rb @@ -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