Skip to content

Commit

Permalink
Only disconnect session on initialization if mongoid is configured. [ f…
Browse files Browse the repository at this point in the history
…ix #2548 ]
  • Loading branch information
durran committed Nov 12, 2012
1 parent 69520f0 commit 9460dac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid/railtie.rb
Expand Up @@ -139,7 +139,7 @@ def self.rescue_responses
# not provide application-level hooks for executing code after the
# process has forked, so we reconnect lazily.
if defined?(Unicorn) && !Unicorn::HttpServer::START_CTX.empty?
::Mongoid.default_session.disconnect
::Mongoid.default_session.disconnect if ::Mongoid.configured?
end

# Passenger provides the :starting_worker_process event for executing
Expand Down

0 comments on commit 9460dac

Please sign in to comment.