[Updater > Module] Minor source cleanup

This commit is contained in:
Ducko 2022-04-21 12:25:17 +01:00
parent 904f51fb28
commit bce146927d
1 changed files with 4 additions and 7 deletions

View File

@ -16,7 +16,7 @@ let skipHost, skipModule,
downloading, installing, downloading, installing,
basePath, manifestPath, downloadPath, basePath, manifestPath, downloadPath,
hostUpdater, hostUpdater,
baseUrl, baseQuery, baseUrl, qs,
checking, hostAvail, last; checking, hostAvail, last;
const resetTracking = () => { const resetTracking = () => {
@ -113,7 +113,7 @@ exports.init = (endpoint, { releaseChannel, version }) => {
hostUpdater.setFeedURL(`${endpoint}/updates/${releaseChannel}?platform=${platform}&version=${version}`); hostUpdater.setFeedURL(`${endpoint}/updates/${releaseChannel}?platform=${platform}&version=${version}`);
baseUrl = `${endpoint}/modules/${releaseChannel}`; baseUrl = `${endpoint}/modules/${releaseChannel}`;
baseQuery = { qs = {
host_version: version, host_version: version,
platform platform
}; };
@ -136,10 +136,7 @@ const checkModules = async () => {
try { try {
const { body } = await request.get({ const { body } = await request.get({
url: baseUrl + '/versions.json', url: baseUrl + '/versions.json',
qs: { qs
...baseQuery,
_: Math.floor(Date.now() / 300000) // 5 min intervals
}
}); });
checking = false; checking = false;
@ -196,7 +193,7 @@ const downloadModule = async (name, ver) => {
try { try {
const resp = await request.get({ const resp = await request.get({
url, url,
qs: baseQuery, qs,
stream stream
}); });