Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
manustars authored Oct 7, 2024
1 parent 6776fa8 commit e1e2e86
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,10 @@ async function refreshMetrics() {
deviceStatusInfo.labels(rig.v4.mmv.workerName, rig.v4.versions[0], device.dsv.name, device.dsv.id, device.dsv.deviceClass, device.mdv.state)
.set(1);

if (Array.isArray(device.speeds)) {
device.speeds.forEach(speed => {
deviceSpeed.labels(rig.v4.mmv.workerName, device.dsv.name, device.dsv.id, device.dsv.deviceClass, speed.algorithm, speed.displaySuffix)
.set(+speed.speed);
});
} else {
console.warn("Speeds is undefined or not an array for device:", device.dsv.name);
}
} catch (e) {
console.error("Errore durante il parsing del dispositivo: ", e);
}
});
device.speeds.forEach(speed => {
deviceSpeed.labels(rig.v4.mmv.workerName, device.dsv.name, device.dsv.id, device.dsv.deviceClass, speed.algorithm, speed.displaySuffix)
.set(+speed.speed);
});
} catch (e) {
console.error("Errore durante il parsing del dispositivo: ", e);
}
Expand Down

0 comments on commit e1e2e86

Please sign in to comment.