From 90640ae9eb21a95f6b5efc3f511496bddfebcc24 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 6 Jun 2024 11:17:11 -0400 Subject: [PATCH] add unicorn configuration to hanami integration app The tests attempt to invoke hanami with unicorn, but the unicorn configuration for hanami was missing resulting in failure. --- integration/apps/hanami/config/unicorn.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 integration/apps/hanami/config/unicorn.rb diff --git a/integration/apps/hanami/config/unicorn.rb b/integration/apps/hanami/config/unicorn.rb new file mode 100644 index 00000000000..4644b64b9c2 --- /dev/null +++ b/integration/apps/hanami/config/unicorn.rb @@ -0,0 +1,23 @@ +require 'datadog/demo_env' + +# config/unicorn.rb +worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) +timeout 15 +preload_app true + +Datadog::DemoEnv.print_env('Unicorn master environment') + +before_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn master intercepting TERM and sending myself QUIT instead' + Process.kill 'QUIT', Process.pid + end +end + +after_fork do |server, worker| + Signal.trap 'TERM' do + puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT' + end + + Datadog::DemoEnv.print_env('Unicorn worker environment') +end