Ensure fallback 'update available' dialog cannot stack

This commit is contained in:
Josh Perez 2020-02-21 15:41:05 -08:00 committed by GitHub
parent 8d9ccd3c0a
commit c347a2761a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 21 deletions

View file

@ -23,7 +23,6 @@ import { markShouldQuit } from '../../app/window_state';
const readdir = pify(readdirCallback);
const unlink = pify(unlinkCallback);
let isChecking = false;
const SECOND = 1000;
const MINUTE = SECOND * 60;
const INTERVAL = MINUTE * 30;
@ -61,13 +60,7 @@ async function checkDownloadAndInstall(
locale: LocaleType,
logger: LoggerType
) {
if (isChecking) {
return;
}
try {
isChecking = true;
logger.info('checkDownloadAndInstall: checking for update...');
const result = await checkForUpdates(logger);
if (!result) {
@ -111,8 +104,6 @@ async function checkDownloadAndInstall(
});
} catch (error) {
logger.error('checkDownloadAndInstall: error', getPrintableError(error));
} finally {
isChecking = false;
}
}