Skip to content

Commit 381f610

Browse files
authored
Apply suggestion from @marcelklehr
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent b3b6451 commit 381f610

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/Service/OpenAiAPIService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ public function request(
11491149
} catch (ClientException|ServerException $e) {
11501150
if ($e->getResponse()->getStatusCode() === 429) {
11511151
if ($retryCount < 3) {
1152-
$sleep = random_int(1, 120);
1152+
$sleep = random_int(10, 120);
11531153
$this->logger->warning("Rate limit exceeded, retrying in $sleep seconds", ['retry_count' => $retryCount]);
11541154
sleep($sleep); // add some jitter to avoid thundering herd problem
11551155
return $this->request($userId, $endPoint, $params, $method, $contentType, $logErrors, $serviceType, $retryCount + 1);

0 commit comments

Comments
 (0)