Skip to content

Commit 7658f68

Browse files
committed
fixed bug when trying to reuse connections
1 parent 03109e7 commit 7658f68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Bolt/BoltConnectionPool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function acquire(
7878

7979
return $connection;
8080
}
81-
if ($connection->getServerState() === 'READY' && !$this->compare($connection, $authenticate)) {
81+
if ($connection->getServerState() === 'READY' && $authenticate === $connection->getFactory()->getAuth()) {
8282
return $connection;
8383
}
8484
}

src/Bolt/BoltResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function rewind(): void
146146

147147
public function __destruct()
148148
{
149-
if ($this->valid() && in_array($this->connection->getServerState(), ['STREAMING', 'TX_STREAMING'], true)) {
149+
if ($this->meta === null && in_array($this->connection->getServerState(), ['STREAMING', 'TX_STREAMING'], true)) {
150150
$this->discard();
151151
}
152152
}

0 commit comments

Comments
 (0)