How to deploy resque workers in production?

后端 未结 4 1784
悲哀的现实
悲哀的现实 2020-12-07 09:56

The GitHub guys recently released their background processing app which uses Redis: http://github.com/defunkt/resque http://github.com/blog/542-introducing-resque

I

4条回答
  •  忘掉有多难
    2020-12-07 10:11

    Use these steps instead of making configuration with web server level and editing plugin:

    #The steps need to be performed to use resque-web with in your application
    
    #In routes.rb
    
    ApplicationName::Application.routes.draw do
      resources :some_controller_name
      mount Resque::Server, :at=> "/resque"
    end
    
    #That's it now you can access it from within your application i.e
    #http://localhost:3000/resque
    
    #To be insured that that Resque::Server is loaded add its requirement condition in Gemfile
    
    gem 'resque', :require=>"resque/server"
    
    #To add  basic http authentication add resque_auth.rb file in initializers folder and add these lines for the security
    
    Resque::Server.use(Rack::Auth::Basic) do |user, password|
      password == "secret"
    end
    
    #That's It !!!!! :)
    
    #Thanks to Ryan from RailsCasts for this valuable information.
    #http://railscasts.com/episodes/271-resque?autoplay=true 
    

    https://gist.github.com/1060167

提交回复
热议问题