Skip to content

Commit

Permalink
fix(api): invalid iface speed conversion for non-docker interface
Browse files Browse the repository at this point in the history
for #105
  • Loading branch information
MauriceNino committed Jun 9, 2022
1 parent 6f37393 commit 2a1425f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/api/src/static-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,8 @@ export const gatherStaticNetworkInfo = async () => {
const { stdout } = await exec(`cat ${NET_PATH}/speed`);
const numValue = Number(stdout.trim());

if (isNaN(numValue) || numValue === -1) {
INFO_SAVE!.network.interfaceSpeed = 0;
} else {
INFO_SAVE!.network.interfaceSpeed = numValue * 1000 * 1000;
}
INFO_SAVE!.network.interfaceSpeed =
isNaN(numValue) || numValue === -1 ? 0 : numValue;
}
} else {
const networkInfo = await si.networkInterfaces();
Expand Down

0 comments on commit 2a1425f

Please sign in to comment.