Skip to content

Commit

Permalink
Revert "feat(http): better handle ECONNRESET errors"
Browse files Browse the repository at this point in the history
This reverts commit 3109494.
  • Loading branch information
seth2810 committed Aug 13, 2024
1 parent 3109494 commit 1ed7ade
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/lib/http/HttpManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export class HttpClient {
requestConfig.retryAttempt ||= 0;

const isRateLimited = err.response && err.response.status === 429;
const isConnectionReset = (err as AxiosError).code === 'ECONNRESET';

if (isRateLimited) {
if (this.config.logRetry) {
Expand All @@ -137,16 +136,6 @@ export class HttpClient {
await sleep(retryAfter * 1_000);

requestConfig.retryAttempt = 0;
} else if (isConnectionReset) {
await sleep(1_000 * (requestConfig.retryAttempt + 1));

requestConfig.retryAttempt += 1;

if (this.config.debug) {
console.log(
`(${requestConfig.retryAttempt}/${this.maxRetryAttempts}) retry ${requestConfig.url} - ${err}`
);
}
} else {
await sleep(1_000);

Expand Down

0 comments on commit 1ed7ade

Please sign in to comment.