We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddb56a5 commit 045a556Copy full SHA for 045a556
lib/mongo/connection.rb
@@ -537,7 +537,7 @@ def connecting?
537
# NOTE: Do check if this needs to be more stringent.
538
# Probably not since if any node raises a connection failure, all nodes will be closed.
539
def connected?
540
- @primary_pool && @primary_pool.host && @primary_pool.port
+ @primary_pool && !@primary_pool.closed?
541
end
542
543
# Determine if the connection is active. In a normal case the *server_info* operation
0 commit comments