Minor tweaks

This commit is contained in:
Marco van Dijk 2024-12-01 16:16:09 +01:00
parent 12bb7c01f4
commit 56c3325b5c

View File

@ -120,9 +120,11 @@ async function processQueue() {
} }
} else { } else {
if (staleENSCache) { if (staleENSCache) {
console.log("Writing ENS cache to disk");
await writeToStorage("ensDomainCache", ensDomainCache); await writeToStorage("ensDomainCache", ensDomainCache);
} }
if (staleOrchCache) { if (staleOrchCache) {
console.log("Writing Orchestrator cache to disk");
await writeToStorage("orchCache", orchCache); await writeToStorage("orchCache", orchCache);
} }
await sleep(1000); await sleep(1000);
@ -413,7 +415,7 @@ async function onOrchUpdate(id, obj, tag, region, livepeer_regions) {
staleOrchCache = true; staleOrchCache = true;
// Update prometheus stats // Update prometheus stats
updatePrometheus(tag, obj.resolv.resolvedTarget, newObj); await updatePrometheus(tag, obj.resolv.resolvedTarget, newObj);
console.log("Handled results for " + newObj.name + " from prober " + tag); console.log("Handled results for " + newObj.name + " from prober " + tag);
} }
@ -513,6 +515,7 @@ async function updateScore(address) {
if (hasEdited) { if (hasEdited) {
orchCache[address.toLowerCase()].leaderboardResults.lastTime = orchCache[address.toLowerCase()].leaderboardResults.lastTime =
new Date().getTime(); new Date().getTime();
staleOrchCache = true;
} }
} }