From 89182c62c0fe4c816c268fc42328606c192ec3eb Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Sun, 21 Mar 2021 17:51:45 +0100 Subject: [PATCH] Fix requests display for web instance --- source/app/web/instance.mjs | 2 +- source/app/web/statics/app.js | 4 ---- source/app/web/statics/index.html | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/source/app/web/instance.mjs b/source/app/web/instance.mjs index 96650674..fe7ce5ef 100644 --- a/source/app/web/instance.mjs +++ b/source/app/web/instance.mjs @@ -89,7 +89,7 @@ let requests = {limit:0, used:0, remaining:0, reset:NaN} if (!conf.settings.notoken) { requests = (await rest.rateLimit.get()).data.rate - setInterval(async() => requests = (await rest.rateLimit.get()).data.rate, 30*1000) + setInterval(async() => requests = (await rest.rateLimit.get()).data.rate, 5*60*1000) } //Web app.get("/", limiter, (req, res) => res.sendFile(`${conf.paths.statics}/index.html`)) diff --git a/source/app/web/statics/app.js b/source/app/web/statics/app.js index 4a3dc498..ae70f4c3 100644 --- a/source/app/web/statics/app.js +++ b/source/app/web/statics/app.js @@ -23,10 +23,6 @@ //GitHub limit tracker const {data:requests} = await axios.get("/.requests") this.requests = requests - setInterval(async () => { - const {data:requests} = await axios.get("/.requests") - this.requests = requests - }, 15000) //Generate placeholder this.mock({timeout:200}) setInterval(() => { diff --git a/source/app/web/statics/index.html b/source/app/web/statics/index.html index de8e8e53..2fc9dfa7 100644 --- a/source/app/web/statics/index.html +++ b/source/app/web/statics/index.html @@ -49,7 +49,7 @@ - {{ requests.limit }} GitHub requests remaining + {{ requests.remaining }} GitHub requests remaining
🖼️ Template