Fix "Cannot Update" dialog's retry button

This commit is contained in:
Fedor Indutny 2022-04-27 16:02:41 -07:00 committed by GitHub
parent 99de97a099
commit 65dc9d6afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 3 deletions

View file

@ -9,9 +9,10 @@ import * as packageJson from '../../package.json';
import { getUserAgent } from '../util/getUserAgent';
import * as durations from '../util/durations';
export const GOT_CONNECT_TIMEOUT = 5 * durations.MINUTE;
export const GOT_LOOKUP_TIMEOUT = 5 * durations.MINUTE;
export const GOT_SOCKET_TIMEOUT = 5 * durations.MINUTE;
export const GOT_CONNECT_TIMEOUT = durations.MINUTE;
export const GOT_LOOKUP_TIMEOUT = durations.MINUTE;
export const GOT_SOCKET_TIMEOUT = durations.MINUTE;
const GOT_RETRY_LIMIT = 3;
export function getProxyUrl(): string | undefined {
return process.env.HTTPS_PROXY || process.env.https_proxy;
@ -47,5 +48,19 @@ export function getGotOptions(): GotOptions {
// This timeout is reset whenever we get new data on the socket
socket: GOT_SOCKET_TIMEOUT,
},
retry: {
limit: GOT_RETRY_LIMIT,
errorCodes: [
'ETIMEDOUT',
'ECONNRESET',
'ECONNREFUSED',
'EPIPE',
'ENOTFOUND',
'ENETUNREACH',
'EAI_AGAIN',
],
methods: ['GET', 'HEAD'],
statusCodes: [413, 429, 503],
},
};
}