Git Product home page Git Product logo

capistrano-resque's Introduction

Changes

Using SIGQUIT to kill processes as they aren't terminating properly.

Capistrano Resque

Basic tasks for putting some Resque in your Cap.

In your Capfile:

require "capistrano-resque"

In your deploy.rb:

role :resque_worker, "app_domain"
role :resque_scheduler, "app_domain"

set :workers, { "my_queue_name" => 2 }

You can also specify multiple queues and the number of workers for each queue:

set :workers, { "archive" => 1, "mailing" => 3, "search_index, cache_warming" => 1 }

The above will start five workers in total:

  • one listening on the archive queue
  • one listening on the search_index, cache_warming queue
  • three listening on the mailing queue

The tasks

Running cap -vT | grep resque should give you...

โž” cap -vT | grep resque
cap resque:status    # Check worksers status
cap resque:start     # Start Resque workers
cap resque:stop      # Quit running Resque workers
cap resque:restart   # Restart running Resque workers
cap resque:scheduler:restart # 
cap resque:scheduler:start   # Starts resque scheduler with default configs
cap resque:scheduler:stop    # Stops resque scheduler

Restart on deployment

To restart you workers automatically when cap deploy:restart is executed add the following line to your deploy.rb:

after "deploy:restart", "resque:restart"

Logging

I've decided to lose the logging ability altogether, in order to keep up with recent versions of Resque, following the chatter on: https://github.com/defunkt/resque/pull/450

If logging is important to you, there's still the 0.0.4 release of this project.

License

Please see the included LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.