1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

fix: switchVersion after switchVersionLater

This commit is contained in:
sunnylqm 2022-05-31 09:52:24 +08:00
parent 6d0a31d749
commit 55aaf4fa45
No known key found for this signature in database
GPG Key ID: 4AB9E14391204EE4

View File

@ -181,11 +181,7 @@ export async function downloadUpdate(options, eventListeners) {
}
if (downloadedHash === options.hash) {
logger(`duplicated downloaded hash ${downloadedHash}, ignored`);
return;
}
if (readyHash) {
logger(`hash ${readyHash} applied. reboot first`);
return;
return downloadedHash;
}
if (downloadingThrottling) {
logger('repeated downloading, ignored');
@ -261,7 +257,6 @@ export async function downloadUpdate(options, eventListeners) {
return options.hash;
}
let readyHash;
function assertHash(hash) {
if (!downloadedHash) {
logger(`no downloaded hash`);
@ -271,11 +266,6 @@ function assertHash(hash) {
logger(`use downloaded hash ${downloadedHash} first`);
return;
}
if (readyHash === hash) {
logger(`hash ${readyHash} already applied. reboot first.`);
return;
}
readyHash = hash;
return true;
}