[Updater > Module] Remove checking already checks

This commit is contained in:
Ducko 2022-04-22 21:31:42 +01:00
parent e5747f4ab7
commit 25ff7efdc0
1 changed files with 1 additions and 12 deletions

View File

@ -18,7 +18,7 @@ let skipHost, skipModule,
basePath, manifestPath, downloadPath, basePath, manifestPath, downloadPath,
hostUpdater, hostUpdater,
baseUrl, qs, baseUrl, qs,
checking, last; last;
const resetTracking = () => { const resetTracking = () => {
const base = { const base = {
@ -88,7 +88,6 @@ exports.init = (endpoint, { releaseChannel, version }) => {
hostUpdater.on('update-manually', d => { hostUpdater.on('update-manually', d => {
log('Modules', 'Host manual'); log('Modules', 'Host manual');
checking = false;
events.emit('manual', { events.emit('manual', {
details: d details: d
@ -96,8 +95,6 @@ exports.init = (endpoint, { releaseChannel, version }) => {
}); });
hostUpdater.on('update-downloaded', () => { hostUpdater.on('update-downloaded', () => {
checking = false;
events.emit('downloaded-module', { events.emit('downloaded-module', {
name: 'host' name: 'host'
}); });
@ -106,8 +103,6 @@ exports.init = (endpoint, { releaseChannel, version }) => {
hostUpdater.on('error', () => { hostUpdater.on('error', () => {
log('Modules', 'Host error'); log('Modules', 'Host error');
checking = false;
events.emit('update-check-finished', { succeeded: false }); events.emit('update-check-finished', { succeeded: false });
}); });
@ -138,10 +133,7 @@ const checkModules = async () => {
url: baseUrl + '/versions.json', url: baseUrl + '/versions.json',
qs qs
}, (e, r, b) => res(JSON.parse(b)))); }, (e, r, b) => res(JSON.parse(b))));
checking = false;
} catch (e) { } catch (e) {
checking = false;
log('Modules', 'Check failed', e); log('Modules', 'Check failed', e);
return events.emit('update-check-finished', { return events.emit('update-check-finished', {
@ -310,9 +302,6 @@ const finishInstall = (name, ver, success) => {
exports.checkForUpdates = () => { exports.checkForUpdates = () => {
log('Modules', 'Checking'); log('Modules', 'Checking');
if (checking) return;
checking = true;
events.emit('checking-for-updates'); events.emit('checking-for-updates');
if (skipHost) hostPassed(); if (skipHost) hostPassed();