mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-07 07:55:47 +01:00
fix(server): bound high-volume issue and log reads
This commit is contained in:
1 parent
73ef40e7be
commit
bfd7af170a
2 files changed
+82
-1
No files matched your search
@@ -212,7 +212,6 @@ export function appendWithByteCap(prev: string, chunk: string, cap = MAX_CAPTURE
|
||||
while (start < buffer.length && (buffer[start]! & 0xc0) === 0x80) start += 1;
|
||||
return buffer.subarray(start).toString("utf8");
|
||||
}
|
||||
|
||||
function resumeReadable(readable: { resume: () => unknown; destroyed?: boolean } | null | undefined) {
|
||||
if (!readable || readable.destroyed) return;
|
||||
readable.resume();
|
||||
@@ -1421,6 +1420,10 @@ export async function runChildProcess(
|
||||
maybeArmTerminalResultCleanup();
|
||||
resumeReadable(readable);
|
||||
});
|
||||
.finally(() => {
|
||||
maybeArmTerminalResultCleanup();
|
||||
resumeReadable(readable);
|
||||
});
|
||||
});
|
||||
|
||||
child.stderr?.on("data", (chunk: unknown) => {
|
||||
@@ -1437,6 +1440,10 @@ export async function runChildProcess(
|
||||
maybeArmTerminalResultCleanup();
|
||||
resumeReadable(readable);
|
||||
});
|
||||
.finally(() => {
|
||||
maybeArmTerminalResultCleanup();
|
||||
resumeReadable(readable);
|
||||
});
|
||||
});
|
||||
|
||||
const stdin = child.stdin;
|
||||
|
||||
Reference in new issue
Block a user