From e51fb26db5247a36362f230c9dbc68801a574ba8 Mon Sep 17 00:00:00 2001 From: Marco van Dijk Date: Fri, 3 Nov 2023 03:56:49 +0100 Subject: [PATCH] more fix --- master/src/routes/hodler.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/master/src/routes/hodler.js b/master/src/routes/hodler.js index 2272a1c..2b10b5e 100644 --- a/master/src/routes/hodler.js +++ b/master/src/routes/hodler.js @@ -198,7 +198,7 @@ const onOrchUpdate = async function (id, obj, tag, region, livepeer_regions) { ensDomain = await getEnsDomain(id); } // Retrieve entry to update or init it - let newObj = orchCache[id]; + let newObj = orchCache[id.toLowerCase()]; if (!newObj) { newObj = { name: obj.name, @@ -329,7 +329,7 @@ const onOrchUpdate = async function (id, obj, tag, region, livepeer_regions) { // Finished updating newObj.instances[obj.resolv.resolvedTarget] = newInstance; newObj.regionalStats[tag] = newRegion; - orchCache[id] = newObj; + orchCache[id.toLowerCase()] = newObj; // Update prometheus stats updatePrometheus(tag, id, obj.resolv.resolvedTarget, newObj); @@ -407,7 +407,7 @@ Main Loop const updateScore = async function (address) { console.log("Checking for new scores for " + address); - const lastTime = orchCache[address].leaderboardResults.lastTime; + const lastTime = orchCache[address.toLowerCase()].leaderboardResults.lastTime; let url = "https://leaderboard-serverless.vercel.app/api/raw_stats?orchestrator=" + @@ -422,7 +422,7 @@ const updateScore = async function (address) { const newSR = instance.round_trip_time / instance.seg_duration; let latitude = null; let longitude = null; - for (const [resolvedTarget, instance] of orchCache[address].instances) { + for (const [resolvedTarget, instance] of orchCache[address.toLowerCase()].instances) { if (instance.livepeer_regions[region]) { latitude = instance.livepeer_regions[region].latitude; longitude = instance.livepeer_regions[region].longitude; @@ -459,7 +459,7 @@ const updateScore = async function (address) { } } if (hasEdited) { - orchCache[address].leaderboardResults.lastTime = new Date().getTime(); + orchCache[address.toLowerCase()].leaderboardResults.lastTime = new Date().getTime(); } };