Skip to content

Commit

Permalink
add unicorn configuration to hanami integration app
Browse files Browse the repository at this point in the history
The tests attempt to invoke hanami with unicorn, but the
unicorn configuration for hanami was missing resulting in failure.
  • Loading branch information
p committed Jun 6, 2024
1 parent 6e9a541 commit 90640ae
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions integration/apps/hanami/config/unicorn.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 90640ae

Please sign in to comment.