[Updater > Module] Minor source cleanup
This commit is contained in:
parent
904f51fb28
commit
bce146927d
|
@ -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
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue