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 6227789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:16:51+00:00 2026-05-24T09:16:51+00:00

I have an app running with apache + passenger in production. Currently I initialize

  • 0

I have an app running with apache + passenger in production. Currently I initialize the rufus scheduler in a initializer and register jobs reading from a db in that initializer. Way apache/passenger works is that it creates multiple process/instance of the app which causes the scheduler to get initialized multiple times and will schedule duplicate jobs.

What is the correct of implementing this so that the scheduler is a singleton object?

  • 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-24T09:16:52+00:00Added an answer on May 24, 2026 at 9:16 am

    You probably want to implement Rufus Scheduler as a separate worker process outside your application.

    Instead of putting it as an initializer, I would implement a Rake task that starts it.

    # Rakefile
    desc "Starts the Scheduler worker"
    task :scheduler do
      require 'path/to/your/scheduler/file'
    
      scheduler.join
    end
    

    Then just run rake scheduler to start it in the background.


    Bonus: Since your app now needs 2 processes side by side, use Foreman to manage the multiple processes of your application. You can do this by creating a file called Procfile:

    # Procfile
    web:       thin start -p 4242
    scheduler: rake scheduler
    

    Then start your app with Foreman: (be sure to gem install foreman first)

    $ foreman start
    

    This will invoke both processes simultaneously.

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

Sidebar

Related Questions

I have a rails app running on my Apache server via Passenger. Occassionally I
I have a Rails app that is running on a production server with Apache
We have a Django app running on apache server (mod_python) on a windows machine
I have a Rails app installed on a Slicehost server running Apache 2 and
I have a web app deployed to three servers running Apache, Tomcat and a
Is this even possible? I have a Rails app running on Passenger and a
I have a trivial WSGI app running on pesto, mod_wsgi and Apache: def viewData(request):
I have a Tomcat app running behind Apache. Apache is configured for HTTPS while
I have a Django app running on Apache with wsgi module. After few hours
I have a apache setup that redirect to my app running on tomcat. Loading

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.