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

15 lines
324 B
Ruby
Raw Permalink 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
2018-01-21 22:21:00 +00:00
Delayed::Worker.logger = Logger.new(Rails.root.join('log', 'delayed_job.log'))