From b38b4d9e7c3e9ff88612c6991bedf762f30e124a Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Sat, 16 Apr 2022 23:21:17 +0200 Subject: [PATCH] Fix taking the right months for scores --- backend/src/routes/livepeer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/routes/livepeer.js b/backend/src/routes/livepeer.js index 54baacf..856e1bf 100644 --- a/backend/src/routes/livepeer.js +++ b/backend/src/routes/livepeer.js @@ -1190,7 +1190,6 @@ const getScoreAtMonthYear = async function (month, year) { const endTime = parseInt(Date.parse(endString) / 1000) // Else get it and cache it const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime; - console.log(url); await https.get(url, (res) => { let body = ""; res.on("data", (chunk) => { @@ -1231,7 +1230,8 @@ apiRouter.post("/getOrchestratorScores", async (req, res) => { try { const { month, year } = req.body; if (month && year) { - const reqObj = await getScoreAtMonthYear(month, year); + // Since months get counted starting at 0 + const reqObj = await getScoreAtMonthYear(month + 1, year); res.send(reqObj); return; }