Sha256: ccf47d41dcb8b6e165f5d7b485f9691fcc1300af323b985235ed0d78aae9c833

Contents?: true

Size: 710 Bytes

Versions: 6

Compression:

Stored size: 710 Bytes

Contents

worker_processes <%= fetch(:unicorn_worker_processes) %>
timeout <%= fetch(:unicorn_timeout) %>

listen "<%= fetch(:unicorn_sock_file) %>"
pid "<%= fetch(:unicorn_pid_file) %>"

stderr_path "<%= fetch(:unicorn_error_log_file) %>"
stdout_path "<%= fetch(:unicorn_log_file) %>"

preload_app true

before_fork do |server, worker|
  defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!

  old_pid = "#{ server.config[:pid] }.oldbin"
  unless 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|
  defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
capistrano-simple-unicorn-1.1.5 lib/generators/capistrano/simple_unicorn/templates/unicorn.rb.erb
capistrano-simple-unicorn-1.0.0 lib/generators/capistrano/simple_unicorn/templates/unicorn.rb.erb
capistrano-simple-unicorn-0.0.4 lib/generators/templates/unicorn.rb.erb
capistrano-simple-unicorn-0.0.3 lib/generators/templates/unicorn.rb.erb
capistrano-simple-unicorn-0.0.2 lib/generators/templates/unicorn.rb.erb
capistrano-simple-unicorn-0.0.1 lib/generators/templates/unicorn.rb.erb