trabajo-afectivo/lib/tasks/zammad/ci/service/puma/stop.rake

27 lines
481 B
Ruby
Raw Normal View History

2018-10-01 17:41:17 +00:00
namespace :zammad do
namespace :ci do
namespace :service do
namespace :puma do
desc 'Stops the puma application webserver'
task :stop do # rubocop:disable Rails/RakeEnvironment
2018-10-01 17:41:17 +00:00
file = Rails.root.join('tmp/pids/server.pid')
2018-10-01 17:41:17 +00:00
pid = File.read(file).to_i
Process.kill('SIGTERM', pid)
sleep 5
next if !File.exist?(file)
Process.kill('SIGKILL', pid)
end
end
end
end
end