Add Capistrano task "sidekiq:stop"
This commit is contained in:
parent
bc908c264a
commit
a22bcabd51
4 changed files with 16 additions and 1 deletions
|
@ -83,7 +83,7 @@ Description=Partynest job processing
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/bundle exec sidekiq --environment production
|
ExecStart=/usr/bin/bundle exec sidekiq --environment production
|
||||||
Group=group
|
Group=group
|
||||||
Restart=on-failure
|
Restart=always
|
||||||
RestartSec=1
|
RestartSec=1
|
||||||
StandardOutput=syslog
|
StandardOutput=syslog
|
||||||
StandardError=syslog
|
StandardError=syslog
|
||||||
|
|
|
@ -54,3 +54,4 @@ append :linked_dirs,
|
||||||
after 'deploy:publishing', 'deploy:restart'
|
after 'deploy:publishing', 'deploy:restart'
|
||||||
|
|
||||||
after 'deploy:restart', 'puma:restart'
|
after 'deploy:restart', 'puma:restart'
|
||||||
|
after 'deploy:restart', 'sidekiq:stop'
|
||||||
|
|
1
config/sidekiq.yml
Normal file
1
config/sidekiq.yml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
:pidfile: tmp/pids/sidekiq.pid
|
13
lib/capistrano/tasks/sidekiq.rake
Normal file
13
lib/capistrano/tasks/sidekiq.rake
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
namespace :sidekiq do
|
||||||
|
dest 'Stop Sidekiq app worker'
|
||||||
|
task :stop do
|
||||||
|
on roles(:app) do
|
||||||
|
within release_path do
|
||||||
|
pidfile = File.join shared_path, 'tmp', 'pids', 'sidekiq.pid'
|
||||||
|
execute :bundle, :exec, :sidekiqctl, :stop, pidfile
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Reference in a new issue