mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-28 17:29:02 +01:00
add a check lol
This commit is contained in:
parent
fa7a749d76
commit
b2d65bba98
1 changed files with 18 additions and 16 deletions
|
@ -73,25 +73,27 @@ function init(app, config, rendertemplate) {
|
||||||
|
|
||||||
initlog("Loaded pages - initing poketube finnished :3");
|
initlog("Loaded pages - initing poketube finnished :3");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
/* PokeTube Update daemon - checks for updates in poketube */
|
setInterval(function () {
|
||||||
(async () => {
|
/* PokeTube Update daemon - checks for updates in poketube */
|
||||||
const url = `https://poketube.fun/api/version.json`;
|
(async () => {
|
||||||
|
const url = `https://poketube.fun/api/version.json`;
|
||||||
|
|
||||||
let f = await modules
|
let f = await modules
|
||||||
.fetch(url)
|
.fetch(url)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((json) => JSON.parse(json));
|
.then((json) => JSON.parse(json));
|
||||||
|
|
||||||
if (f.vernum == api) {
|
if (f.vernum == api) {
|
||||||
console.log("[UPDATE DAEMON] PokeTube is up to date!");
|
console.log("[UPDATE DAEMON] PokeTube is up to date!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f.vernum != api) {
|
if (f.vernum != api) {
|
||||||
console.warn(
|
console.warn(
|
||||||
"[UPDATE DAEMON] PokeTube is out of date! please re-clone the poketube repo :p "
|
"[UPDATE DAEMON] PokeTube is out of date! please re-clone the poketube repo :p "
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
}, 150000);
|
||||||
}, 150000);
|
}, 150000);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
initlog("[FAILED] Load pages \n" + err);
|
initlog("[FAILED] Load pages \n" + err);
|
||||||
|
|
Loading…
Reference in a new issue