Skip to content

Commit dc2c6b8

Browse files
committed
keep uri information when resolving addresses
1 parent 08b5e1a commit dc2c6b8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Neo4j/Neo4jConnectionPool.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function acquire(SessionConfiguration $config): Generator
117117
$key = $this->createKey($this->data, $config);
118118

119119
/** @var RoutingTable|null */
120-
$table = $this->cache->get($key, null);
120+
$table = $this->cache->get($key);
121121
$triedAddresses = [];
122122

123123
$latestError = null;
@@ -130,13 +130,7 @@ public function acquire(SessionConfiguration $config): Generator
130130
foreach ($addresses as $address) {
131131
$triedAddresses[] = $address;
132132

133-
$uri = Uri::create($address);
134-
$port = $this->data->getUri()->getPort();
135-
if ($port !== null) {
136-
$uri = $uri->withPort($port);
137-
}
138-
139-
$pool = $this->createOrGetPool($uri);
133+
$pool = $this->createOrGetPool($this->data->getUri()->withHost($address));
140134
try {
141135
/** @var BoltConnection $connection */
142136
$connection = GeneratorHelper::getReturnFromGenerator($pool->acquire($config));

0 commit comments

Comments
 (0)