From 08e898bdb9206a9587af3b0d806571d2faf614eb Mon Sep 17 00:00:00 2001 From: Ardiea Date: Tue, 21 Mar 2023 08:21:13 -0400 Subject: [PATCH] fix: Updated the unicorn_tcp fork behavior Updated the unicorn_tcp before_fork and after_fork behaviors to be consistent with mongodb documentation. --- config/unicorn_tcp.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/unicorn_tcp.rb b/config/unicorn_tcp.rb index ef0dbcd147b..120ce58a526 100644 --- a/config/unicorn_tcp.rb +++ b/config/unicorn_tcp.rb @@ -19,4 +19,9 @@ after_fork do |server, worker| ::Mongoid.default_client.close + ::Mongoid.default_client.reconnect +end + +before_fork do |server, worker| + ::Mongoid.disconnect_clients end