Fix "Cannot Update" dialog's retry button
This commit is contained in:
parent
99de97a099
commit
65dc9d6afb
2 changed files with 25 additions and 3 deletions
|
@ -180,6 +180,13 @@ export abstract class Updater {
|
|||
|
||||
const mainWindow = this.getMainWindow();
|
||||
mainWindow?.webContents.send('show-update-dialog', dialogType);
|
||||
|
||||
this.setUpdateListener(async () => {
|
||||
this.logger.info('updater/markCannotUpdate: retrying after user action');
|
||||
|
||||
this.markedCannotUpdate = false;
|
||||
await this.checkForUpdatesMaybeInstall();
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -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],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue