chore(fetcher): bring back error retry

This commit is contained in:
WebStreamr 2025-09-12 17:53:37 +00:00
parent fdb9bff86b
commit 69da82b139
No known key found for this signature in database

View file

@ -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;
};