2

失败时如何启用从 sidekiq 发送的电子邮件?目前我知道异常通知器正在工作,但当 sidekiq 作业失败时,它什么也不做。

4

1 回答 1

3
class DelayedWorker

  include Sidekiq::Worker
  # Utils include watchdog, which will email on failures
  include Sidekiq::Util

  def perform(type, args)
    watchdog('DelayedWorker failed') do
      raise 'Doh!'
      puts "Doing hard work #{type} #{args.to_json}"
    end
  end

end

还要确保你有更新版本的异常通知器,它在它的handle_background_exception方法中接受 2 个参数

于 2012-10-22T19:12:14.810 回答