* Read a background task's captured output. Returns the in-memory * ring buffer if available, otherwise falls back to the persisted * ` /tasks/ /output.log`. `tail` caps the returned * string to that many trailing characters.
(
taskId: string,
options: { tail?: number } = {},
)
| 320 | * string to that many trailing characters. |
| 321 | */ |
| 322 | async getBackgroundTaskOutput( |
| 323 | taskId: string, |
| 324 | options: { tail?: number } = {}, |
| 325 | ): Promise<string> { |
| 326 | this.ensureOpen(); |
| 327 | const trimmedTaskId = normalizeRequiredString( |
| 328 | taskId, |
| 329 | 'Task id cannot be empty', |
| 330 | ErrorCodes.BACKGROUND_TASK_ID_EMPTY, |
| 331 | ); |
| 332 | return this.rpc.getBackgroundTaskOutput({ |
| 333 | sessionId: this.id, |
| 334 | taskId: trimmedTaskId, |
| 335 | tail: options.tail, |
| 336 | }); |
| 337 | } |
| 338 | |
| 339 | /** |
| 340 | * Request a running background task to stop. Sends SIGTERM with a |
no test coverage detected