Add Mongoid.reconnect_clients and improve forking webserver documentation

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Unknown
    • 9.0.0
    • Affects Version/s: None
    • Component/s: Docs
    • None
    • None
    • Ruby Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      See PR: https://github.com/mongodb/mongoid/pull/5808

      ^^^

      Currently there is a  Mongoid.disconnect_clients method but no Add Mongoid.reconnect_clients method. The documentation currently recommends this:

       

      before_fork do |server, worker|
        Mongoid.disconnect_clients
      end 
      
      after_fork do |server, worker|
        Mongoid::Clients.clients.each do |name, client|
          client.close
          client.reconnect
        end
      end

      The after_fork should have a single Mongoid.reconnect_clients method instead of ad-hoc code.

       

              Assignee:
              Jamis Buck
              Reporter:
              Johnny Shields
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: