diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 5c19c11..a181b87 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -313,6 +313,13 @@ export class Fetcher { } } + if (response.status >= 500 && tryCount < 3) { + this.logger.warn(`Retrying fetch ${init?.method ?? 'GET'} ${url} because of error`, ctx); + await this.sleep(333); + + return await this.fetchWithTimeout(ctx, url, init, ++tryCount); + } + return response; };