Pergunta

I am using Rails4, sidekiq and capistrano3 (ruby 2.1.0).

My deploy config is working without sidekiq. When i am using sidekiq, I have got an error during this command:

/usr/bin/env bundle exec sidekiqctl quiet /home/deployer/apps/getLead/current/tmp/sidekiq.pid
Tasks: TOP => sidekiq:quiet

I am trying to run this command on my VPS and see, that "Process doesn't exist"

I have included require 'sidekiq/capistrano' in my Capfile, and try to play with options in deploy.rb:

=begin
set(:sidekiq_cmd) { "#{bundle_cmd} exec sidekiq" }
set(:sidekiqctl_cmd) { "#{bundle_cmd} exec sidekiqctl" }
set(:sidekiq_timeout) { 10 }
set(:sidekiq_role) { :app }
set(:sidekiq_pid) { "#{current_path}/tmp/pids/sidekiq.pid" }
set(:sidekiq_processes) { 1 }
=end
set :sidekiq_cmd,           ->{ "bundle exec sidekiq" }
set :sidekiqctl_cmd,        ->{ "bundle exec sidekiqctl" }

Here is my sidekiq.yml config

:verbose: false
:pidfile: tmp/sidekiq.pid
:concurrency:  25
:queues:
  - [often, 7]
  - [default, 5]
  - [seldom, 3]

How can I make it work? Thanks in advance!

Foi útil?

Solução

I had a similar problem, and i fixed it look for other bundle tasks comand in deploy log (for example db:migrate) :

sidekiq_cmd_pre = 'cd #{current_path} && ( PATH=/home/deployer/.rvm/bin:$PATH RAILS_ENV=production ~/.rvm/bin/rvm default do'
set :sidekiq_cmd, -> { "#{sidekiq_cmd_pre} bundle exec sidekiq)" }
set :sidekiqctl_cmd, -> { "#{sidekiq_cmd_pre} bundle exec sidekiqctl" }

P.S. not beautiful, but work )

P.P.S need

set :sidekiq_pid, -> { "tmp/pids/sidekiq.pid" }

remove #{current_path}

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top