change to 60 seconds

This commit is contained in:
fk 2024-10-03 15:46:12 +02:00
parent 8d38b87989
commit 6212ff3cb9
Signed by: fk
SSH key fingerprint: SHA256:KQRtpoT/zoUtKcHNokD4N151te4gRMvc/3RHpxNd+Pk

View file

@ -96,7 +96,6 @@
const margin = 20 const margin = 20
for (const [_, bot] of Object.entries(bots)) { for (const [_, bot] of Object.entries(bots)) {
console.log(bot)
ctx.lineWidth = 4 ctx.lineWidth = 4
ctx.strokeStyle = bot.color_ring ctx.strokeStyle = bot.color_ring
ctx.beginPath() ctx.beginPath()
@ -104,7 +103,6 @@
for (let i = 1; i < bot.x.length; i++) { for (let i = 1; i < bot.x.length; i++) {
ctx.lineTo(getX(width, margin, 0, graph_data.game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i])) ctx.lineTo(getX(width, margin, 0, graph_data.game, bot.x[i]), getY(height, margin, graph_data.min_elo, graph_data.max_elo, bot.y[i]))
} }
console.log("stroking")
ctx.stroke() ctx.stroke()
} }
} catch (err) { } catch (err) {
@ -118,9 +116,9 @@
canvas.height = canvas.clientHeight * window.devicePixelRatio; canvas.height = canvas.clientHeight * window.devicePixelRatio;
} }
// Poll the server every 5 seconds // Poll the server every 60 seconds
setInterval(fetchLeaderboardData, 5000); setInterval(fetchLeaderboardData, 60_000);
setInterval(draw_graph, 5000); setInterval(draw_graph, 60_000);
// Initial load // Initial load
fetchLeaderboardData(); fetchLeaderboardData();