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