Skip to content

Instantly share code, notes, and snippets.

@ravzski
Created August 24, 2018 11:51
Show Gist options
  • Save ravzski/d57cc90267e3eed042803f3384e4e1db to your computer and use it in GitHub Desktop.
Save ravzski/d57cc90267e3eed042803f3384e4e1db to your computer and use it in GitHub Desktop.
puma work around
#NOTES:
#0:16 = threads
#-w 2 = workers
#this will also load puma config located in config/puma.rb
namespace :deploy do
desc 'Restarting application'
task :restart do
on roles(:app) do
within release_path do
with rails_env: fetch(:rails_env) do
execute "pkill -9 -f 'rb-fsevent|rails|spring|puma'"
execute "cd #{current_path} && ~/.rvm/bin/rvm #{rvm_ruby_version} do RAILS_ENV=production bundle exec puma -t 0:16 -w 2 -d"
end
end
end
end
end
after "deploy:publishing", "deploy:restart"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment