Sha256: db9e7b1e2dd7608a03b7efa9ccfc6493f466e811375d2b39d48f2abe564b019b

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 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'])
  bind 'unix://tmp/sockets/puma.sock'
  pidfile 'tmp/pids/puma.pid'
  state_path 'tmp/pids/puma.state'
  daemonize ENV['RAILS_DAEMONIZE'].present?
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

4 entries across 4 versions & 2 rubygems

Version Path
eivo-rails-api-0.1.3 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.4 lib/generators/eivo/templates/config/puma.rb
eivo-rails-api-0.1.2 lib/generators/eivo/templates/config/puma.rb
eivo-rails-0.1.3 lib/generators/eivo/templates/config/puma.rb