delayed_job_worker_pool
delayed_job_worker_pool copied to clipboard
Using without Rails
Just wondered if it would be possible to make this support running without Rails? We have an app which runs jobs with delayed_job but no Rails on Heroku. Was hoping this might help us to increase the number of jobs we can process without scaling dynos horizontally or re-architecturing to sidekiq for now.
When running without Rails we hit the following error, regardless of setting preload_app (true|false):
Worker failed with error: Could not find Rails initialization file /app/config/environment.rb. Make sure delayed_job_worker_pool is run from the Rails root directory
The preload_app
setting controls whether the DelayedJobWorkerPool::Application.load
method is invoked in the controller process before forking any workers or in the workers post-fork. The DelayedJobWorkerPool::Application.load
assumes it's a Rails app but a PR would be welcome that adds a configurable load app hook for non-Rails apps.