Bladeren bron

Always return 1 for health in MongoClient::getHosts

Looking at the legacy driver, this has always returned 1 since the method was refactored waaay back in 2012. It's safe to say that we don't need to rely on a field from the isMaster response.
Andreas Braun 5 jaren geleden
bovenliggende
commit
c46e6a74b8
1 gewijzigde bestanden met toevoegingen van 1 en 1 verwijderingen
  1. 1 1
      lib/Mongo/MongoClient.php

+ 1 - 1
lib/Mongo/MongoClient.php

@@ -222,7 +222,7 @@ class MongoClient
             $results[$key] = [
                 'host' => $server->getHost(),
                 'port' => $server->getPort(),
-                'health' => (int) $info['ok'],
+                'health' => 1,
                 'state' => $state,
                 'ping' => $server->getLatency(),
                 'lastPing' => null,