puma.rb 469 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. worker_count = Integer(ENV['WEB_CONCURRENCY'] || 0)
  3. workers worker_count
  4. threads_count_min = Integer(ENV['MIN_THREADS'] || 5)
  5. threads_count_max = Integer(ENV['MAX_THREADS'] || 30)
  6. threads threads_count_min, threads_count_max
  7. environment ENV.fetch('RAILS_ENV', 'development')
  8. preload_app!
  9. if worker_count.positive?
  10. on_worker_boot do
  11. ActiveRecord::Base.establish_connection
  12. end
  13. end