Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6585939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:43:38+00:00 2026-05-25T16:43:38+00:00

I have a dedicated server for delayed_job tasks. I want to start, stop, and

  • 0

I have a dedicated server for delayed_job tasks. I want to start, stop, and restart delayed_job workers on only this server. I am using the capistrano recipes provided by delayed_job.

When I only had 1 server, this was my config:

before "deploy:restart", "delayed_job:stop"
after  "deploy:restart", "delayed_job:start"

after "deploy:stop",    "delayed_job:stop"
after "deploy:start",   "delayed_job:start"

Now I want to have those hooks only apply to a separate delayed_job server (role :delayed_job <ip address>). Is this possible to do elegantly? Do I have to wrap each delayed_job tasks in a meta task? Or write my own tasks and not use the ones provided by delayed job?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:43:38+00:00Added an answer on May 25, 2026 at 4:43 pm

    When you define a task in Capistrano you can restrict the execution of the task to specific role(s). The way you do this is by passing the :role option.

    It seems the default delayed_job Capistrano recipe does this.

    desc "Stop the delayed_job process"
    task :stop, :roles => lambda { roles } do
      run "cd #{current_path};#{rails_env} script/delayed_job stop"
    end
    

    According to the source code, the task fetches the list of roles from the :delayed_job_server_role configuration variable.

    Back to your problem, to narrow the execution of the tasks to a specific group of servers, define a new role (for example worker) in your deploy.rb

    role :worker, "192.168.1.1" # Assign the IP of your machine
    

    Then set the :delayed_job_server_role to that name

    set :delayed_job_server_role, :worker
    

    That’s all. Now the tasks will be executed, but only to the servers listed in the :worker role.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create website thumbnails (screenshots) using php. I have a dedicated server
we have a old and dying dedicated server. we want a new one at
So I have access to a dedicated server and want to finally create my
I have a myisam only dedicated 32 GB RAM mysql server that is running
I have a plesk panel and root dedicated server on 1and1. I'm using custom
I want to convert and show video that user uploaded. I have dedicated server
Currently I have a dedicated server with WHM and Joomla running. I want to
Good evening, I have a Dedicated Server in a data center and i want
I have a dedicated server and I'm in need for building new version of
I am building an Asp.net MVC site where I have a fast dedicated server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.