(taskId: string)
| 347 | } |
| 348 | |
| 349 | background(taskId: string): boolean { |
| 350 | if (this.#status === 'running') { |
| 351 | this.#backgroundTaskId = taskId |
| 352 | this.#status = 'backgrounded' |
| 353 | this.#cleanupListeners() |
| 354 | if (this.taskOutput.stdoutToFile) { |
| 355 | // File mode: child writes directly to the fd with no JS involvement. |
| 356 | // The foreground timeout is gone, so watch file size to prevent |
| 357 | // a stuck append loop from filling the disk (768GB incident). |
| 358 | this.#startSizeWatchdog() |
| 359 | } else { |
| 360 | // Pipe mode: spill the in-memory buffer so readers can find it on disk. |
| 361 | this.taskOutput.spillToDisk() |
| 362 | } |
| 363 | return true |
| 364 | } |
| 365 | return false |
| 366 | } |
| 367 | |
| 368 | cleanup(): void { |
| 369 | this.#stdoutWrapper?.cleanup() |
no test coverage detected