2012-10-22 34 views

回答

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 

另外,還要確保你有例外通知的新版本,這需要在2個參數到它的handle_background_exception方法

相關問題