Skip to content
This repository has been archived by the owner on Mar 20, 2018. It is now read-only.

Commit

Permalink
Mounting resque sinatra app to look at the queues and failed jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelpetry committed Jul 9, 2013
1 parent e628bf6 commit 425b2a6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions config/initializers/resque.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require 'resque/server'

Resque::Server.use(Rack::Auth::Basic) do |user, password|
password == ENV['RESQUE_SERVER_PASSWORD']
end
4 changes: 4 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require 'resque/server'

Victorykit::Application.routes.draw do
get "privacy/index"

Expand Down Expand Up @@ -59,6 +61,8 @@
resources :on_demand_email
resources :heartbeat
resources :unsubscribes, only: [:index]

mount Resque::Server.new, at: '/resque'
end
root :to => "site#index"
end
2 changes: 1 addition & 1 deletion lib/tasks/resque.rake
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ task 'resque:setup' => :environment do
end

Resque.after_fork do |job|
ActiveRecord::Base.establish_connection
NewRelic::Agent.after_fork(:report_to_channel => job.object_id,
:report_instance_busy => false)
ActiveRecord::Base.establish_connection
end

if ENV['AIRBRAKE_API_KEY']
Expand Down

0 comments on commit 425b2a6

Please sign in to comment.