This commit is contained in:
f 2020-02-26 12:28:48 -03:00
parent 56e4d9145f
commit f7a84fedcb
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 6 additions and 5 deletions

View file

@ -18,5 +18,5 @@ set :default_env, {
web_concurrency: '1'
}
after 'deploy:published', 'puma:stop'
after 'puma:stop', 'puma:start'
after 'deploy:published', 'pumx:stop'
after 'pumx:stop', 'pumx:start'

View file

@ -35,4 +35,4 @@ preload_app!
# Allow puma to be restarted by `rails restart` command.
plugin :tmp_restart
pidfile 'tmp/puma.pid'
pidfile 'tmp/pids/puma.pid'

View file

@ -1,6 +1,6 @@
# frozen_string_literal: true
namespace :pumo do
namespace :pumx do
desc 'Start puma'
task :start do
on roles(:web) do
@ -14,7 +14,8 @@ namespace :pumo do
task :stop do
on roles(:web) do
within current_path do
execute "cat #{current_path}/tmp/puma.pid | xargs kill"
pid = "#{current_path}/tmp/pids/puma.pid"
execute "test -f '#{pid}' && cat '#{pid}' | xargs kill"
end
end
end