mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
reduce child process stdout and stderr buffer limits in tui renderer
This commit is contained in:
parent
f9fd620b8b
commit
69ff9c364c
1 changed files with 6 additions and 6 deletions
|
|
@ -1895,9 +1895,9 @@ export class TuiRenderer {
|
|||
if (child.stdout) {
|
||||
child.stdout.on("data", (data: Buffer) => {
|
||||
stdout += data.toString();
|
||||
// Limit buffer size to 10MB
|
||||
if (stdout.length > 10 * 1024 * 1024) {
|
||||
stdout = stdout.slice(0, 10 * 1024 * 1024);
|
||||
// Limit buffer size to 2MB
|
||||
if (stdout.length > 2 * 1024 * 1024) {
|
||||
stdout = stdout.slice(0, 2 * 1024 * 1024);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -1905,9 +1905,9 @@ export class TuiRenderer {
|
|||
if (child.stderr) {
|
||||
child.stderr.on("data", (data: Buffer) => {
|
||||
stderr += data.toString();
|
||||
// Limit buffer size to 10MB
|
||||
if (stderr.length > 10 * 1024 * 1024) {
|
||||
stderr = stderr.slice(0, 10 * 1024 * 1024);
|
||||
// Limit buffer size to 1MB
|
||||
if (stderr.length > 1 * 1024 * 1024) {
|
||||
stderr = stderr.slice(0, 1 * 1024 * 1024);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue