1
0
Fork 0

Add Capistrano task "sidekiq:stop"

This commit is contained in:
Alex Kotov 2018-12-09 09:54:05 +05:00
parent bc908c264a
commit a22bcabd51
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
4 changed files with 16 additions and 1 deletions

View File

@ -83,7 +83,7 @@ Description=Partynest job processing
[Service]
ExecStart=/usr/bin/bundle exec sidekiq --environment production
Group=group
Restart=on-failure
Restart=always
RestartSec=1
StandardOutput=syslog
StandardError=syslog

View File

@ -54,3 +54,4 @@ append :linked_dirs,
after 'deploy:publishing', 'deploy:restart'
after 'deploy:restart', 'puma:restart'
after 'deploy:restart', 'sidekiq:stop'

1
config/sidekiq.yml Normal file
View File

@ -0,0 +1 @@
:pidfile: tmp/pids/sidekiq.pid

View 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