Skip to content

Commit

Permalink
Fix requests display for web instance
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlighter committed Mar 21, 2021
1 parent 861a0e5 commit 89182c6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion source/app/web/instance.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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`))
Expand Down
4 changes: 0 additions & 4 deletions source/app/web/statics/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
2 changes: 1 addition & 1 deletion source/app/web/statics/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<button @click="generate" :disabled="(!user)||(generated.pending)">
{{ generated.pending ? 'Working on it :)' : 'Generate your metrics!' }}
</button>
<small>{{ requests.limit }} GitHub requests remaining</small>
<small>{{ requests.remaining }} GitHub requests remaining</small>

<div class="configuration">
<b>🖼️ Template</b>
Expand Down

0 comments on commit 89182c6

Please sign in to comment.