fixi res.send for expires test scores

This commit is contained in:
Marco van Dijk 2022-04-22 03:01:24 +02:00
parent 1bb86ce587
commit 7e68fe45ed

View File

@ -2578,12 +2578,12 @@ apiRouter.post("/getOrchestratorScores", async (req, res) => {
const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime; const url = "https://leaderboard-serverless.vercel.app/api/aggregated_stats?since=" + startTime + "&until=" + endTime;
console.log("Getting new Orchestrator scores for " + year + "-" + month + " @ " + url); console.log("Getting new Orchestrator scores for " + year + "-" + month + " @ " + url);
https.get(url, (res) => { https.get(url, (res2) => {
let body = ""; let body = "";
res.on("data", (chunk) => { res2.on("data", (chunk) => {
body += chunk; body += chunk;
}); });
res.on("end", () => { res2.on("end", () => {
try { try {
const data = JSON.parse(body); const data = JSON.parse(body);
const scoreObj = { const scoreObj = {