Sha256: 0c1367eab4b8a26b7297bace6469ff54a46d6af81dbf1ea7f51cbdcd03ebf454

Contents?: true

Size: 615 Bytes

Versions: 4

Compression:

Stored size: 615 Bytes

Contents

worker_processes Integer(ENV['WEB_CONCURRENCY'] || 3)
timeout Integer(ENV['WEB_TIMEOUT'] || 15)
preload_app true

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

  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.connection.disconnect!
end

after_fork do |server, worker|

  Signal.trap 'TERM' do
    puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
  end

  defined?(ActiveRecord::Base) and
    ActiveRecord::Base.establish_connection
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bretels-1.0.3 templates/unicorn.rb
bretels-1.0.2 templates/unicorn.rb
bretels-1.0.1 templates/unicorn.rb
bretels-1.0.0 templates/unicorn.rb