mirror of
https://github.com/stronk-dev/OrchestratorTracker.git
synced 2025-07-05 10:55:09 +02:00
Finally fixed leaderboard prometheus reinit from storage on restart
This commit is contained in:
parent
17cc8e8e7f
commit
903a9b85c2
@ -554,12 +554,13 @@ const recoverStorage = async function () {
|
|||||||
// Re-init from storage
|
// Re-init from storage
|
||||||
for (const [id, obj] of Object.entries(orchCache)) {
|
for (const [id, obj] of Object.entries(orchCache)) {
|
||||||
const thisName = obj.name;
|
const thisName = obj.name;
|
||||||
|
const thisInstances = obj.instances;
|
||||||
|
|
||||||
// Latest leaderboard results observed
|
// Latest leaderboard results observed
|
||||||
if (obj.leaderboardResults) {
|
if (obj.leaderboardResults) {
|
||||||
for (const [region, res] of Object.entries(obj.leaderboardResults)) {
|
for (const [region, res] of Object.entries(obj.leaderboardResults)) {
|
||||||
// Skip the lastTime accessor - only use last observed regional stats
|
// Skip the lastTime accessor - only use last observed regional stats
|
||||||
if (!res.latestRTR || res.latestSR) {
|
if (res.latestRTR == null || res.latestSR == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
console.log(
|
console.log(
|
||||||
@ -572,6 +573,16 @@ const recoverStorage = async function () {
|
|||||||
"%, livepeer region " +
|
"%, livepeer region " +
|
||||||
region
|
region
|
||||||
);
|
);
|
||||||
|
let latitude = null;
|
||||||
|
let longitude = null;
|
||||||
|
for (const [resolvedTarget, instance] of Object.entries(
|
||||||
|
thisInstances
|
||||||
|
)) {
|
||||||
|
if (instance.livepeer_regions[region]) {
|
||||||
|
latitude = instance.latitude;
|
||||||
|
longitude = instance.longitude;
|
||||||
|
}
|
||||||
|
}
|
||||||
promLatestRTR.set(
|
promLatestRTR.set(
|
||||||
{
|
{
|
||||||
livepeer_region: region,
|
livepeer_region: region,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user