dansch
dansch

Reputation: 6267

sidekiq won't send exception notifier emails

How can I enable emails to be sent from sidekiq when it fails? Currently I know exception notifier is working, though when a sidekiq job fails, it doesn't do anything.

Upvotes: 2

Views: 1203

Answers (1)

dansch
dansch

Reputation: 6267

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

Also make sure you have the newer version of exception notifier, which takes in 2 arguments into it's handle_background_exception method

Upvotes: 3

Related Questions