Skip to content

Commit 29960e8

Browse files
committed
Only retry transaction function in case of known transient error
1 parent 5eb28e0 commit 29960e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Common/TransactionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function retry(callable $tsxFactory, callable $tsxHandler, Transac
4646

4747
return $tbr;
4848
} catch (Neo4jException $e) {
49-
if (microtime(true) > $limit) {
49+
if (microtime(true) > $limit || !str_contains($e->getMessage(), '(Neo.ClientError.Cluster.NotALeader)')) {
5050
throw $e;
5151
}
5252
}

0 commit comments

Comments
 (0)