summaryrefslogtreecommitdiff
path: root/config/puma_production.rb
blob: 31bea2d430cc6b7a6e1a00e64457df3398057785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

rails_root = File.expand_path("../..", __FILE__)

environment ENV['RAILS_ENV'] || "production"

bind "unix:#{rails_root}/tmp/sockets/puma.sock"
bind "tcp://127.0.0.1:9292"

# Set master PID and state locations
pidfile "#{rails_root}/tmp/pids/puma.pid"
state_path "#{rails_root}/tmp/pids/puma.state"
activate_control_app

on_worker_boot do
  require "active_record"
  ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
  ActiveRecord::Base.establish_connection
end