puma.rb 547 B

12345678910111213141516171819202122
  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. on_booted do
  10. AppVersion.start_maintenance_thread(process_name: 'puma')
  11. end
  12. if worker_count.positive?
  13. on_worker_boot do
  14. ActiveRecord::Base.establish_connection
  15. end
  16. end