Sha256: 1ecb0632caa350cf5a9a5b282800bae801ddfed709ff582df2913a6b2f912ed9

Contents?: true

Size: 678 Bytes

Versions: 3

Compression:

Stored size: 678 Bytes

Contents

working_directory "<%= current_path %>"
pid "<%= fetch(:unicorn_pid) %>"
stderr_path "<%= fetch(:unicorn_log) %>"
stdout_path "<%= fetch(:unicorn_log) %>"

listen "/tmp/unicorn.<%= fetch(:application) %>.sock"
worker_processes <%= fetch(:unicorn_workers) %>
timeout <%= fetch(:unicorn_timeout) %>

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
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

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-devops-0.0.15 lib/capistrano/devops/templates/unicorn.erb
capistrano-devops-0.0.14 lib/capistrano/devops/templates/unicorn.erb
capistrano-devops-0.0.13 lib/capistrano/devops/templates/unicorn.erb