Sha256: 49b6f2cf451f5db8896d56521621336c0bedea2f40e6b75a11dfb4feaa831c9f

Contents?: true

Size: 839 Bytes

Versions: 9

Compression:

Stored size: 839 Bytes

Contents

rails_env = ENV['RACK_ENV'] || 'production'
worker_processes 2
working_directory '/home/deploy/<%= @application_name %>/current'

listen '/tmp/<%= @application_name %>.sock', :backlog => 2048
listen 5001, :tcp_nopush => true

timeout 60
pid "/home/deploy/<%= @application_name %>/shared/pids/unicorn.pid"
preload_app  true
GC.respond_to?(:copy_on_write_friendly=) and
  GC.copy_on_write_friendly = true

stderr_path '/home/deploy/<%= @application_name %>/shared/log/<%= @application_name %>.log'

before_fork do |server, worker|
  ActiveRecord::Base.connection.disconnect!
  old_pid = "#{server.config[:pid]}.oldbin"
  if old_pid != server.pid
    begin
     Process.kill('QUIT', File.read(old_pid).to_i)
    rescue Errno::ENOENT, Errno::ESRCH
    end
  end
end

after_fork do |server, worker|
  ActiveRecord::Base.establish_connection
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pixelforce_cms-0.9.9.9 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.8 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.7 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.6 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.5 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.4 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.3 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.2 lib/generators/pixelforce_cms/templates/unicorn.rb
pixelforce_cms-0.9.9.1 lib/generators/pixelforce_cms/templates/unicorn.rb