From 7e68fe45ed6dfd60ff1101b24200bc4d3c813fa1 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 22 Apr 2022 03:01:24 +0200 Subject: [PATCH] fixi res.send for expires test scores --- backend/src/routes/livepeer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/routes/livepeer.js b/backend/src/routes/livepeer.js index 3d6f244..3043611 100644 --- a/backend/src/routes/livepeer.js +++ b/backend/src/routes/livepeer.js @@ -2578,12 +2578,12 @@ apiRouter.post("/getOrchestratorScores", async (req, res) => { const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime; console.log("Getting new Orchestrator scores for " + year + "-" + month + " @ " + url); - https.get(url, (res) => { + https.get(url, (res2) => { let body = ""; - res.on("data", (chunk) => { + res2.on("data", (chunk) => { body += chunk; }); - res.on("end", () => { + res2.on("end", () => { try { const data = JSON.parse(body); const scoreObj = {