Sha256: 90287c93a34a4c644390691fd2e097d5e46c0712e98a3d4523221e49608de38c

Contents?: true

Size: 757 Bytes

Versions: 9

Compression:

Stored size: 757 Bytes

Contents

# frozen_string_literal: true

workers ENV.fetch('WEB_CONCURRENCY') { 0 }
threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
threads threads_count, threads_count

environment ENV.fetch('RAILS_ENV') { 'development' }

if %w[production staging].include?(ENV['RAILS_ENV'])
  pidfile 'tmp/pids/puma.pid'
  state_path 'tmp/pids/puma.state'
  daemonize ENV.fetch('RAILS_DAEMONIZE') { false }

  if ENV['PORT']
    bind "tcp://0.0.0.0:#{ENV['PORT']}"
  else
    bind 'unix://tmp/sockets/puma.sock'
  end
else
  port ENV.fetch('PORT') { 3000 }
end

before_fork do
  ActiveRecord::Base.connection.disconnect!
end

on_worker_boot do
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Base.establish_connection
  end
end

preload_app!

plugin :tmp_restart

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
eivo-rails-api-0.1.9 lib/generators/eivo/templates/config/puma.rb
eivo-rails-api-0.1.8 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.9 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.8 lib/generators/eivo/templates/config/puma.rb
eivo-rails-api-0.1.7 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.7 lib/generators/eivo/templates/config/puma.rb
eivo-rails-api-0.1.6 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.6 lib/generators/eivo/templates/config/puma.rb
eivo-rails-api-0.1.5 lib/generators/eivo/templates/config/puma.rb