|
|
@ -9,18 +9,17 @@ let interval;
|
|
|
|
exports.startInterval = () => {
|
|
|
|
exports.startInterval = () => {
|
|
|
|
let check = async () => {
|
|
|
|
let check = async () => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
const res = await axios.get("https://raw.githubusercontent.com/louislam/uptime-kuma/master/package.json");
|
|
|
|
const res = await axios.get("https://uptime.kuma.pet/version");
|
|
|
|
|
|
|
|
|
|
|
|
if (typeof res.data === "string") {
|
|
|
|
|
|
|
|
res.data = JSON.parse(res.data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// For debug
|
|
|
|
// For debug
|
|
|
|
if (process.env.TEST_CHECK_VERSION === "1") {
|
|
|
|
if (process.env.TEST_CHECK_VERSION === "1") {
|
|
|
|
res.data.version = "1000.0.0";
|
|
|
|
res.data.slow = "1000.0.0";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (res.data.slow) {
|
|
|
|
|
|
|
|
exports.latestVersion = res.data.slow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
exports.latestVersion = res.data.version;
|
|
|
|
|
|
|
|
} catch (_) { }
|
|
|
|
} catch (_) { }
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|