mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 04:23:40 +00:00
Fix: Error Messages in HealthCheck (#2759)
* Fix: Error Messages in HealthCheck * Update sdk/package/lib/util/SubContainer.ts Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> * fix ts error --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: Aiden McClelland <me@drbonez.dev>
This commit is contained in:
@@ -258,18 +258,12 @@ export class SubContainer implements ExecSpawnable {
|
|||||||
await new Promise<null>((resolve) => child.stdin.end(resolve))
|
await new Promise<null>((resolve) => child.stdin.end(resolve))
|
||||||
}
|
}
|
||||||
const pid = child.pid
|
const pid = child.pid
|
||||||
const stdout = { data: "" as string | Buffer }
|
const stdout = { data: "" as string }
|
||||||
const stderr = { data: "" as string | Buffer }
|
const stderr = { data: "" as string }
|
||||||
const appendData =
|
const appendData =
|
||||||
(appendTo: { data: string | Buffer }) =>
|
(appendTo: { data: string }) => (chunk: string | Buffer | any) => {
|
||||||
(chunk: string | Buffer | any) => {
|
if (typeof chunk === "string" || chunk instanceof Buffer) {
|
||||||
if (typeof appendTo.data === "string" && typeof chunk === "string") {
|
appendTo.data += chunk.toString()
|
||||||
appendTo.data += chunk
|
|
||||||
} else if (typeof chunk === "string" || chunk instanceof Buffer) {
|
|
||||||
appendTo.data = Buffer.concat([
|
|
||||||
new Uint8Array(Buffer.from(appendTo.data).buffer),
|
|
||||||
new Uint8Array(Buffer.from(chunk).buffer),
|
|
||||||
])
|
|
||||||
} else {
|
} else {
|
||||||
console.error("received unexpected chunk", chunk)
|
console.error("received unexpected chunk", chunk)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user