I migrated from mongoid 4 to 5. In unicorn, do I need to disconnect from mongoid in before_fork?
New mongoid uses the connection pool. Disconnecting wasn't needed in older versions of mongoid.
I migrated from mongoid 4 to 5. In unicorn, do I need to disconnect from mongoid in before_fork?
New mongoid uses the connection pool. Disconnecting wasn't needed in older versions of mongoid.
In mongoid5 the driver was replaced by mongo-ruby-driver.
Looking at the code (+ also verified with cycling the unicorn workers), after fork the connection will be disconnected upon first touch with the db. So you don't have to do that, unless optimising for living connection or such.
HTH