Skip to content

Commit 16e6646

Browse files
committed
Do retry on Unknown metric error, because Google API sometimes do some wierd things
1 parent 683a8ed commit 16e6646

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/Google/RestApi.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ protected function decideRetry(int $retries, int $maxRetries, ?ResponseInterface
324324
return false;
325325
}
326326
if ($statusCode === 400) {
327+
if (strpos((string) $response->getBody(), 'Unknown metric') !== false) {
328+
return true;
329+
}
327330
return false;
328331
}
329332
if ($statusCode === 401 && $retries > 0) { //allow only one retry for refreshing token

0 commit comments

Comments
 (0)