Home Delayed job stopped working after changing server from passenger to puma
Reply: 0

Delayed job stopped working after changing server from passenger to puma

user1975
1#
user1975 Published in June 23, 2018, 4:19 am

Recently I just changed server for my production environment from passenger to puma. Before puma delayed job was working fine without any error but after puma it stopped working.

I am running 3 Delayed job to handle incoming requests on two different servers by dividing them as server 1 : 1 Job and server 2 : 2 Jobs.

RAILS_ENV=production bin/delayed_job -i first --queues=job_1,job_2 start

This command I am using to start delayed job after deployment. I am using Capistrano 3 for deployment. Also I have upgrade version of Capistrano version 2 to 3.

In Capistrano 2 we had

require 'delayed/recepies'

but as per delayed job official documentation I have created a rake task and executing in order to start job again.

It creates a new entry in delayed_jobs table as Delayed::Backend::ActiveRecord::Job.

What's wrong I am doing here? Is there any worker not listening to my incoming calls? Should I need to start additional things?

----UPDATED----

This is the rake task I have created to restart the jobs.

task :restart do
  on roles(delayed_job_roles) do
    within release_path do
      with rails_env: fetch(:rails_env) do
        execute('cd #{current_path};RAILS_ENV=production bin/delayed_job -i first --queues=job_1,job_2 stop')
        execute('cd #{current_path};RAILS_ENV=production bin/delayed_job -i second --queues=job_1,job_2 start')
      end
    end
  end
end

after 'deploy:publishing', 'delayed_job:restart'

As I have mentioned that I am running two seperate servers to manage delayed_jobs. On server 2 delayed_job.log file is not updated with latest logs. When I try to run delayed_job it executes on server 1 instead of server 2. Queues are running over server 2 to handle those jobs and when it runs on server 1 it couldn't find the exact source, which I am looking for to get executed.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.311004 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO