metamaps--metamaps/config/initializers/delayed_job.rb

15 lines
330 B
Ruby
Raw Normal View History

2017-10-17 16:16:03 +00:00
# frozen_string_literal: true
2017-09-13 14:11:04 +00:00
2017-10-17 16:16:03 +00:00
module ExceptionNotifierInDelayedJob
def handle_failed_job(job, error)
super
ExceptionNotfier.notify_exception(error)
end
end
2017-09-13 14:11:04 +00:00
2017-10-17 16:16:03 +00:00
Delayed::Worker.class_eval do
prepend ExceptionNotifierInDelayedJob
2017-09-13 14:11:04 +00:00
end
2017-10-17 16:16:03 +00:00
Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))