瀏覽代碼

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 年之前
父節點
當前提交
c46e6a74b8
共有 1 個文件被更改,包括 1 次插入1 次删除
  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,