Skip to content

Commit

Permalink
if "STATE_VOLUMES" is more critical, it takes over
Browse files Browse the repository at this point in the history
  • Loading branch information
odeimaiz committed Oct 30, 2024
1 parent fa64d45 commit c0e5d78
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ qx.Class.define("osparc.workbench.DiskUsageController", {
this.__socket.on("serviceDiskUsage", data => {
if (data["node_id"] && this.__callbacks[data["node_id"]]) {
// notify
this.setDiskUsageNotificationToUI(data);
this.__evaluateDisplayMessage(data);
this.__callbacks[data["node_id"]].forEach(cb => {
cb(data);
})
Expand Down Expand Up @@ -81,7 +81,7 @@ qx.Class.define("osparc.workbench.DiskUsageController", {
return warningLevel
},

setDiskUsageNotificationToUI: function(data) {
__evaluateDisplayMessage: function(data) {
const id = data["node_id"];
if (!this.__callbacks[id]) {
return;
Expand Down Expand Up @@ -121,8 +121,11 @@ qx.Class.define("osparc.workbench.DiskUsageController", {

if ("STATE_VOLUMES" in data.usage) {
const diskVolsUsage = data.usage["STATE_VOLUMES"];
const freeVolsSpace = osparc.utils.Utils.bytesToSize(diskVolsUsage.free);
const volsWarningLevel = this.__getWarningLevel(diskVolsUsage.free);
if (diskVolsUsage["used_percent"] > diskHostUsage["used_percent"]) {
// "STATE_VOLUMES" is more critical so it takes over
freeSpace = osparc.utils.Utils.bytesToSize(diskVolsUsage.free);
warningLevel = this.__getWarningLevel(diskVolsUsage.free);
}
}

const objIndex = this.__prevDiskUsageStateList.findIndex((obj => obj.nodeId === id));
Expand Down

0 comments on commit c0e5d78

Please sign in to comment.