Permalink
Browse files

Added Resque/Hoptoad-Airbrake integration

Upgraded Hoptoad-notifier gem to Airbrake gem
  • Loading branch information...
1 parent 8ab6a99 commit 4e0abdbe2ddde7f8d751215239e89351fc9fbe65 @adahmash adahmash committed Feb 23, 2012
Showing with 25 additions and 6 deletions.
  1. +3 −1 Gemfile
  2. +9 −4 Gemfile.lock
  3. +1 −1 config/initializers/hoptoad.rb
  4. +12 −0 config/initializers/resque.rb
View
@@ -22,6 +22,7 @@ gem "bitly"
gem "redis"
gem "redis-namespace"
gem "resque", :git => 'git://github.com/defunkt/resque.git'
+gem "resque-retry"
gem "resque-scheduler", :require => 'resque_scheduler'
gem 'sitemap_generator'
gem "SystemTimer"
@@ -40,7 +41,8 @@ gem 'i18n_backend_database', :git => "git://github.com/chewbranca/i18n_backend_d
# JVD: Use this when developing, checkout the i18n_backend_database to ../
# gem 'i18n_backend_database', :path => "../i18n_backend_database"
-gem "hoptoad_notifier"
+#gem "hoptoad_notifier"
+gem "airbrake"
gem "acts-as-taggable-on"
gem 'redis-store'
View
@@ -115,6 +115,9 @@ GEM
rails (~> 3.0)
acts_as_tree (0.1.1)
addressable (2.2.6)
+ airbrake (3.0.9)
+ activesupport
+ builder
amazon-ecs (2.2.4)
nokogiri (~> 1.4)
ruby-hmac (~> 0.3)
@@ -189,9 +192,6 @@ GEM
hashie (1.2.0)
highline (1.6.11)
hike (1.2.1)
- hoptoad_notifier (2.4.11)
- activesupport
- builder
httmultiparty (0.3.6)
httparty (>= 0.7.3)
multipart-post
@@ -296,6 +296,10 @@ GEM
redis (< 3.0.0)
redis-store (1.0.0.1)
redis (~> 2.2.1)
+ resque-retry (0.2.2)
+ rake
+ resque (>= 1.8.0)
+ resque-scheduler (>= 1.8.0)
resque-scheduler (1.9.9)
redis (>= 2.0.1)
resque (>= 1.8.0)
@@ -372,6 +376,7 @@ DEPENDENCIES
acl9
acts-as-taggable-on
acts_as_tree
+ airbrake
amazon-ecs
awesome_print
aws-s3
@@ -390,7 +395,6 @@ DEPENDENCIES
formtastic!
friendly_id (= 3.3.1)
haml
- hoptoad_notifier
i18n_backend_database!
json
launchy
@@ -414,6 +418,7 @@ DEPENDENCIES
redis-namespace
redis-store
resque!
+ resque-retry
resque-scheduler
routing-filter
rr
@@ -1,7 +1,7 @@
hoptoad_api_key = Metadata::Setting.table_exists? ? ( Metadata::Setting.find_setting('hoptoad_api_key').try(:value) || APP_CONFIG['hoptoad_api_key'] ) : nil
if hoptoad_api_key
- HoptoadNotifier.configure do |config|
+ Airbrake.configure do |config|
config.api_key = hoptoad_api_key
end
end
@@ -1,5 +1,8 @@
require 'yaml'
require 'resque'
+require 'resque/failure/airbrake'
+require 'resque/failure/redis'
+require 'resque/failure/multiple'
rails_root = (defined?(Rails) && Rails.root) || File.expand_path(File.dirname(__FILE__) + '/../..')
rails_env = ENV['RAILS_ENV'] || (defined?(Rails) && Rails.env.to_s) || 'development'
@@ -29,3 +32,12 @@
resque_schedule_file = File.exists?(resque_schedule_base_file) ? resque_schedule_base_file : (resque_schedule_base_file.to_s + '.sample')
resque_schedule_config = YAML.load_file(resque_schedule_file)
Resque.schedule = resque_schedule_config
+
+
+# Failure Backends Setup
+Resque::Failure::Airbrake.configure do |config|
+ config.api_key = Airbrake.configuration.api_key
+end
+
+Resque::Failure::Multiple.classes = [Resque::Failure::Redis, Resque::Failure::Airbrake]
+Resque::Failure.backend = Resque::Failure::Multiple

0 comments on commit 4e0abdb

Please sign in to comment.