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

13 lines
244 B
Ruby
Raw Permalink Normal View History

2017-10-17 01:15:47 +00:00
# frozen_string_literal: true
2017-10-17 01:04:44 +00:00
module ExceptionNotifierInDelayedJob
def handle_failed_job(job, error)
2017-10-17 01:15:47 +00:00
super
2017-10-17 01:04:44 +00:00
ExceptionNotfier.notify_exception(error)
end
end
2017-09-13 14:11:04 +00:00
2017-10-17 01:04:44 +00:00
Delayed::Worker.class_eval do
prepend ExceptionNotifierInDelayedJob
2017-09-13 14:11:04 +00:00
end