Sha256: 802098da9c686458acf0323d7dbd135587026523b00b6f5d04de0a12c2c83a01

Contents?: true

Size: 725 Bytes

Versions: 5

Compression:

Stored size: 725 Bytes

Contents

environment ENV['RAILS_ENV']

threads ENV['PUMA_THREADS_MIN'].to_i, ENV['PUMA_THREADS_MAX'].to_i
workers ENV['PUMA_WORKERS'].to_i

pidfile "#{ENV['PROJECT_PATH']}/tmp/puma.pid"

if ENV['RAILS_ENV'] == 'production'
  bind "unix://#{ENV['PROJECT_PATH']}/tmp/puma.sock"
else
  port '3000'
end

# https://github.com/puma/puma/blob/master/examples/config.rb#L125
prune_bundler

restart_command 'bundle exec bin/puma'

on_worker_boot do
  require 'active_record'

  config_path = File.expand_path('../database.yml', __FILE__)
  ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
  ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'] || YAML.load_file(config_path)[ENV['RAILS_ENV']])
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
orats-0.8.0 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.7.3 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.7.2 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.7.1 lib/orats/templates/includes/new/rails/config/puma.rb
orats-0.7.0 lib/orats/templates/includes/new/rails/config/puma.rb