Skip to content

Commit 03109e7

Browse files
committed
only discard results that are not consumed yet
1 parent 6c4679e commit 03109e7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Bolt/BoltConnection.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ final class BoltConnection implements ConnectionInterface
4545
/** @psalm-readonly */
4646
private BoltFactory $factory;
4747

48-
private int $ownerCount = 0;
4948
private string $serverState = 'DISCONNECTED';
5049
/** @var list<WeakReference<CypherList>> */
5150
private array $subscribedResults = [];

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 (in_array($this->connection->getServerState(), ['STREAMING', 'TX_STREAMING'], true)) {
149+
if ($this->valid() && in_array($this->connection->getServerState(), ['STREAMING', 'TX_STREAMING'], true)) {
150150
$this->discard();
151151
}
152152
}

src/Bolt/Session.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
*/
4141
final class Session implements SessionInterface
4242
{
43-
/** @psalm-readonly */
43+
/** @psalm-readonly */
4444
private SessionConfiguration $config;
4545
/**
4646
* @psalm-readonly
@@ -56,7 +56,7 @@ final class Session implements SessionInterface
5656
private FormatterInterface $formatter;
5757
/** @psalm-readonly */
5858
private UriInterface $uri;
59-
/** @psalm-readonly */
59+
/** @psalm-readonly */
6060
private AuthenticateInterface $auth;
6161

6262
/**
@@ -164,6 +164,7 @@ private function acquireConnection(TransactionConfiguration $config, SessionConf
164164
// Since the client should not run indefinitely, we just multiply the client side by two, just in case
165165
$timeout = $config->getTimeout();
166166
if ($timeout) {
167+
$timeout = ($timeout < 30) ? 30 : $timeout;
167168
$connection->setTimeout($timeout * 2);
168169
}
169170

0 commit comments

Comments
 (0)