MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / readCgroupFile

Function readCgroupFile

packages/engine/src/services/systemMemory.ts:104–114  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

102}
103
104function readCgroupFile(path: string): string | null {
105 try {
106 return readFileSync(path, "utf8");
107 } catch (error) {
108 const code = getErrorCode(error);
109 if (code !== "ENOENT" && code !== "ENOTDIR") {
110 warnCgroupReadFailure(path, error);
111 }
112 return null;
113 }
114}
115
116function getErrorCode(error: unknown): string | undefined {
117 if (typeof error !== "object" || error === null || !("code" in error)) {

Callers 1

getCgroupLimitMbFunction · 0.85

Calls 2

getErrorCodeFunction · 0.85
warnCgroupReadFailureFunction · 0.85

Tested by

no test coverage detected