Sha256: c3cd7a12bac18ce779c2364aa9199c002777ed7ac576b90539cb59acd9ac915e

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
# http://michaelvanrooijen.com/articles/2011/06/01-more-concurrency-on-a-single-heroku-dyno-with-the-new-celadon-cedar-stack/

# worker_processes 1 # amount of unicorn workers to spin up
# timeout 30         # restarts workers that hang for 30 seconds

worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
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 send QUIT'
  end

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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fat_free_crm-0.14.2 config/unicorn.rb
fat_free_crm-0.14.1 config/unicorn.rb
fat_free_crm-0.15.0.beta config/unicorn.rb
fat_free_crm-0.14.0 config/unicorn.rb
reduced_fat_crm-0.15.0.beta config/unicorn.rb
reduced_fat_crm-0.14.0 config/unicorn.rb