<commit_before>workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

tag         'deploy-it'
rackup      DefaultRackup
environment ENV['RAILS_ENV'] || 'development'

preload_app!

bind "tcp://127.0.0.1:#{(ENV['PORT'] || 5000)}"

if ENV['RAILS_ENV'] == 'production'
  daemonize            true
  pidfile              File.join(Dir.pwd, 'tmp', 'pids', 'puma.pid')
  state_path           File.join(Dir.pwd, 'tmp', 'sockets', 'puma.state')
  activate_control_app "unix://#{File.join(Dir.pwd, 'tmp', 'sockets', 'pumactl.sock')}"
  stdout_redirect      File.join(Dir.pwd, 'log', 'puma.stdout.log'), File.join(Dir.pwd, 'log', 'puma.stderr.log')

  on_worker_boot do
    ActiveRecord::Base.establish_connection
  end
end<commit_msg>Use a socket for Puma in production<commit_after>workers Integer(ENV['WEB_CONCURRENCY'] || 2)
threads_count = Integer(ENV['MAX_THREADS'] || 5)
threads threads_count, threads_count

tag         'deploy-it'
rackup      DefaultRackup
environment ENV['RAILS_ENV'] || 'development'

preload_app!

if ENV['RAILS_ENV'] == 'production'
  daemonize            true
  bind                 "unix://#{File.join(Dir.pwd, 'tmp', 'sockets', 'puma.sock')}"
  pidfile              File.join(Dir.pwd, 'tmp', 'pids', 'puma.pid')
  state_path           File.join(Dir.pwd, 'tmp', 'sockets', 'puma.state')
  activate_control_app "unix://#{File.join(Dir.pwd, 'tmp', 'sockets', 'pumactl.sock')}"
  stdout_redirect      File.join(Dir.pwd, 'log', 'puma.stdout.log'), File.join(Dir.pwd, 'log', 'puma.stderr.log')

  on_worker_boot do
    ActiveRecord::Base.establish_connection
  end
else
  bind "tcp://127.0.0.1:#{(ENV['PORT'] || 5000)}"
end
{'fraction_non_alphanumeric': 0.17472335468841002, 'fraction_numerical': 0.013977868375072802, 'mean_word_length': 3.86685552407932, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1820869', 'n_tokens_mistral': 666, 'n_tokens_neox': 643, 'n_words': 115}