Sha256: 36cf45c83e724e8443f0a38c11ace3ab8b105d74fafae197cd0175fe251d503d
Contents?: true
Size: 1019 Bytes
Versions: 12
Compression:
Stored size: 1019 Bytes
Contents
working_directory "<%= current_path %>" pid "<%= unicorn_pid %>" stderr_path "<%= unicorn_std_log %>" stdout_path "<%= unicorn_err_log %>" listen "/tmp/socket.<%= application %>_<%= stage %>.sock", :backlog => <%= unicorn_listen_backlog %> worker_processes <%= unicorn_worker_processes %> timeout 30 preload_app true before_fork do |server, worker| # Disconnect since the database connection will not carry over if defined? ActiveRecord::Base ActiveRecord::Base.connection.disconnect! end # Quit the old unicorn process old_pid = "#{server.config[:pid]}.oldbin" if File.exists?(old_pid) && server.pid != old_pid begin Process.kill("QUIT", File.read(old_pid).to_i) rescue Errno::ENOENT, Errno::ESRCH # someone else did our job for us end end end after_fork do |server, worker| # Start up the database connection again in the worker if defined?(ActiveRecord::Base) ActiveRecord::Base.establish_connection end end
Version data entries
12 entries across 12 versions & 2 rubygems