Skip to content

Commit

Permalink
Node/http: stop got from doing its own retries
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed Feb 2, 2023
1 parent 22f3b97 commit 0799324
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/platform/nodejs/lib/util/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ const Http: typeof IHttp = class {

doOptions.url = uri;
doOptions.timeout = { request: ((rest && rest.options.timeouts) || Defaults.TIMEOUTS).httpRequestTimeout };
// We have our own logic that retries appropriate statuscodes to fallback endpoints,
// with timeouts constructed appropriately. Don't want `got` doing its own retries to
// the same endpoint, inappropriately retrying 429s, etc
doOptions.retry = {limit: 0};

(got[method](doOptions) as CancelableRequest<Response>)
.then((res: Response) => {
Expand Down

0 comments on commit 0799324

Please sign in to comment.