summary refs log tree commit diff
path: root/src/util/util/AutoUpdate.ts
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/util/util/AutoUpdate.ts (renamed from util/src/util/AutoUpdate.ts)5
1 files changed, 2 insertions, 3 deletions
diff --git a/util/src/util/AutoUpdate.ts b/src/util/util/AutoUpdate.ts

index 531bd8b7..7d020106 100644 --- a/util/src/util/AutoUpdate.ts +++ b/src/util/util/AutoUpdate.ts
@@ -1,4 +1,3 @@ -import "missing-native-js-functions"; import fetch from "node-fetch"; import ProxyAgent from 'proxy-agent'; import readline from "readline"; @@ -18,7 +17,7 @@ export function enableAutoUpdate(opts: { downloadType?: "zip"; }) { if (!opts.checkInterval) return; - var interval = 1000 * 60 * 60 * 24; + let interval = 1000 * 60 * 60 * 24; if (typeof opts.checkInterval === "number") opts.checkInterval = 1000 * interval; const i = setInterval(async () => { @@ -76,7 +75,7 @@ async function getLatestVersion(url: string) { try { const agent = new ProxyAgent(); const response = await fetch(url, { agent }); - const content = await response.json(); + const content: any = await response.json(); return content.version; } catch (error) { throw new Error("[Auto update] check failed for " + url);