Skip to content

Commit

Permalink
Correction of null values
Browse files Browse the repository at this point in the history
  • Loading branch information
bgelatti committed Nov 26, 2024
1 parent 671f527 commit 80be0eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/server/Services/Hardware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,15 @@ export async function getDiskUsages(): Promise<IComputerUsage[]> {
description: `${formatBytes(x.used)} / ${formatBytes(x.size)}`,
detail: x.mount,
title: `Disk ${i + 1}`,
total: x.size === null || x.size === undefined || Number.isNaN(x.size) ? 0 : x.size,
total:
x.size === null || x.size === undefined || Number.isNaN(x.size)
? 0
: x.size,
type: "disk",
used: x.used === null || x.used === undefined || Number.isNaN(x.used) ? 0 : x.used,
used:
x.used === null || x.used === undefined || Number.isNaN(x.used)
? 0
: x.used,
};
});
}
Expand Down
3 changes: 1 addition & 2 deletions plugins/tagoio-integration/src/back/RealtimeConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import os from "node:os";
import { URLSearchParams } from "node:url";
import { core, helpers, pluginStorage } from "@tago-io/tcore-sdk";
import EventSource from "eventsource";
import removeNullValues from "../../../../packages/sdk/src/Types/Helpers/removeNullValues.ts";
import { cache } from "./Global.ts";
import { getMachineID } from "./Helpers.ts";
import { sendDataToTagoio } from "./Request.ts";
import removeNullValues from "../../../../packages/sdk/src/Types/Helpers/removeNullValues.ts";
import { IComputerUsage } from "@tago-io/tcore-sdk/types";

let events: EventSource | null = null;
const pingInterval = 240000;
Expand Down

0 comments on commit 80be0eb

Please sign in to comment.