# Change to match your CPU core count
workers Integer(ENV['WEB_CONCURRENCY'] || 1)
threads_count = Integer(ENV['RAILS_MAX_THREADS'] || 3)

# Min and Max threads per worker
threads threads_count, threads_count

rackup      DefaultRackup
port        ENV['PORT']     || 3000
environment ENV['RAILS_ENV'] || 'production'

# app_dir = File.expand_path("../../..", __FILE__)
# shared_dir = "#{app_dir}/shared"
# daemonize true
# preload_app!

# # Set up socket location
# bind "unix://#{shared_dir}/tmp/sockets/puma.sock"

# # Logging
# stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true

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

# on_worker_boot do
#   # require "active_record"
#   # ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
#   # ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env])
# end

