Resque Notifier is a Resque plugin that sends notifications when a job fails.
Ruby 2.2.0
Add this line to your application's Gemfile:
gem 'resque-notifier'
And then execute:
$ bundle
Or install it yourself as:
$ gem install resque-notifier
example: Slack
RESQUE_HOOK=https://hooks.slack.com/services/<generated_hash>
RESQUE_CHANNEL="#channel-name"
example: if you access your failed jobs through resque-web on http://my.domain.com/resque/overview
RESQUE_HOST=http://my.domain.com
require 'resque/failure/notifier'
Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Notifier]
Resque::Failure.backend = Resque::Failure::Multiple
If you are using Slack, you can define a channel to receive failed job messages. Multiple errors are ignored until they are cleared from Resque. Resque-Notifier will only send the first failed job of the same Class and Exception names. For example:
Worker: mac000dwright.local:28852:*
Class: http://my.domain.com/resque/failed/?class=User
Exception: NoMethodError
Error: undefined method `some_method' for nil:NilClass
- Fork it ( https://github.com/[my-github-username]/resque-notifier/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request