You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
522 B

  1. threads_count = ENV.fetch('MAX_THREADS') { 5 }.to_i
  2. threads threads_count, threads_count
  3. port ENV.fetch('PORT') { 3000 }
  4. environment ENV.fetch('RAILS_ENV') { 'development' }
  5. workers ENV.fetch('WEB_CONCURRENCY') { 2 }
  6. preload_app!
  7. on_worker_boot do
  8. if ENV['HEROKU'] # Spawn the workers from Puma, to only use one dyno
  9. @sidekiq_pid ||= spawn('bundle exec sidekiq -q default -q push -q pull -q mailers ')
  10. end
  11. ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
  12. end
  13. plugin :tmp_restart