Skip to content

Commit 3154bcf

Browse files
committed
Don't delay throwing exception on the last retry
1 parent 0ed20f0 commit 3154bcf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ApiCall.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ private function makeRequest(string $method, string $endPoint, bool $asJson, arr
282282
} catch (Exception $exception) {
283283
$this->setNodeHealthCheck($node, false);
284284
$lastException = $exception;
285-
sleep($this->config->getRetryIntervalSeconds());
285+
if ($numRetries < $this->config->getNumRetries() + 1) {
286+
sleep($this->config->getRetryIntervalSeconds());
287+
}
286288
}
287289
}
288290

0 commit comments

Comments
 (0)