Giter Site home page Giter Site logo

capistrano3-delayed-job's Introduction

Capistrano::DelayedJob Gem Version

Delayed Job support for Capistrano 3.x

Installation

Add this line to your application's Gemfile:

gem 'capistrano3-delayed-job', '~> 1.0'
gem 'capistrano'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano3-delayed-job

Usage

Require in Capfile to use the default task:

require 'capistrano/delayed-job'

You will get the following tasks

cap delayed_job:start                    # Start delayed_job service
cap delayed_job:stop                     # Stop delayed_job service
cap delayed_job:restart                  # Restart delayed_job service

Configurable options (copy into deploy.rb), shown here with examples:

# Number of delayed_job workers
# default value: 1
set :delayed_job_workers, 2

# String to be prefixed to worker process names
# This feature allows a prefix name to be placed in front of the process.
# For example:  reports/delayed_job.0  instead of just delayed_job.0
set :delayed_job_prefix, :reports               

# Delayed_job queue or queues
# Set the --queue or --queues option to work from a particular queue.
# default value: nil
set :delayed_job_queues, ['mailer','tracking']

# Specify different pools
# You can use this option multiple times to start different numbers of workers for different queues.
# default value: nil
set :delayed_job_pools, {
    :mailer => 2,
    :tracking => 1,
    :* => 2
}

# Set the roles where the delayed_job process should be started
# default value: :app
set :delayed_job_roles, [:app, :background]

# Set the location of the delayed_job executable
# Can be relative to the release_path or absolute
# default value 'bin'
set :delayed_job_bin_path, 'script' # for rails 3.x

### Set the location of the delayed_job logfile
set :delayed_log_dir, 'path_to_logfile'

### Set the location of the delayed_job pid file
set :delayed_job_pid_dir, 'path_to_pid_dir'

It also adds the following hook

after 'deploy:published', 'restart' do
    invoke 'delayed_job:restart'
end

Following setting is recommended to avoid stop/restart problem. See #16 or #22 for more detail.

set: linked_dirs, %w(tmp/pids)

# or

set :delayed_job_pid_dir, '/tmp'

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Credits

Thank you contributors!

Platanus

capistrano3-delayed-job is maintained by platanus.

License

Guides is © 2014 platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.

capistrano3-delayed-job's People

Contributors

blackjid avatar muratayusuke avatar rbowman222222 avatar samuelpismel avatar dperezrada avatar jschroe212 avatar scottrobertson avatar dadamsuk avatar mdongsheng avatar

Watchers

 avatar

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.