chore(fetcher): bring back error retry
This commit is contained in:
parent
fdb9bff86b
commit
69da82b139
1 changed files with 7 additions and 0 deletions
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue