Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5758

Add Mongoid.reconnect_clients and improve forking webserver documentation

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

      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@mongodb.com Jamis Buck
            Reporter:
            shields@tablecheck.com Johnny Shields
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: