(taskId: string)
| 376 | * Clean up a task's output file and write queue. |
| 377 | */ |
| 378 | export async function cleanupTaskOutput(taskId: string): Promise<void> { |
| 379 | const output = outputs.get(taskId) |
| 380 | if (output) { |
| 381 | output.cancel() |
| 382 | outputs.delete(taskId) |
| 383 | } |
| 384 | |
| 385 | try { |
| 386 | await unlink(getTaskOutputPath(taskId)) |
| 387 | } catch (e) { |
| 388 | const code = getErrnoCode(e) |
| 389 | if (code === 'ENOENT') { |
| 390 | return |
| 391 | } |
| 392 | logError(e) |
| 393 | } |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Initialize output file for a new task. |
nothing calls this directly
no test coverage detected