-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
defaults.rb
36 lines (26 loc) · 701 Bytes
/
defaults.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env puma
rails_root = File.expand_path("../../..", __FILE__)
directory rails_root
rackup "#{rails_root}/config.ru"
tag ""
pidfile "#{rails_root}/tmp/pids/puma.pid"
state_path "#{rails_root}/tmp/pids/puma.state"
stdout_redirect "#{rails_root}/log/puma_access.log", "#{rails_root}/log/puma_error.log", true
bind "unix:https://#{rails_root}/tmp/sockets/puma.sock"
daemonize
threads 0, 16
workers 2
preload_app!
plugin :tmp_restart
on_restart do
puts "Refreshing Gemfile"
ENV["BUNDLE_GEMFILE"] = ""
end
before_fork do
ActiveRecord::Base.connection_pool.disconnect!
end
on_worker_boot do
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.establish_connection
end
end