From 924e6c037a73d200f1777feca6b105b500cbfeb1 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Sun, 14 May 2017 18:37:55 +0300 Subject: [PATCH] Add puma config --- config/puma.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 config/puma.rb diff --git a/config/puma.rb b/config/puma.rb new file mode 100644 index 000000000..53c3cead5 --- /dev/null +++ b/config/puma.rb @@ -0,0 +1,14 @@ +preload_app! + +threads 1, 4 +workers 2 + +on_worker_boot do + ActiveSupport.on_load(:active_record) do + ActiveRecord::Base.establish_connection + end +end + +before_fork do + ActiveRecord::Base.connection_pool.disconnect! +end