Question

I am using the delayed_job module and foreman for background processing. I have a job called "ImportTitlesJob". I want to process queued jobs of this job type 2 at a time.

I am using upstart to export my jobs and I have used the foreman export tool to do this with the concurrency flag. I can see that there are 2 worker jobs exported and running in 2 processes however only 1 of my 2 queued jobs is being processed at a time.

Here is what is in my Procfile:

worker: bundle exec rake jobs:work RAILS_ENV=production

I am using this command to export the procfile to upstart which creates two workers:

sudo foreman export --app app_name --user ubuntu --concurrency worker=2 upstart /etc/init

How can I run my jobs 2 at a time?

Do I need to used named queues for each of my jobs when queuing them?

Was it helpful?

Solution

I have managed to solve this problem by using the named queues when queuing the jobs.

This can be done by passing the :queue parameter to the job when queuing it with Delayed jobs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top