(filePath: string, data: string)
| 632 | } |
| 633 | |
| 634 | private async appendToFile(filePath: string, data: string): Promise<void> { |
| 635 | try { |
| 636 | await fsAppendFile(filePath, data, { mode: 0o600 }) |
| 637 | } catch { |
| 638 | // Directory may not exist — some NFS-like filesystems return |
| 639 | // unexpected error codes, so don't discriminate on code. |
| 640 | await mkdir(dirname(filePath), { recursive: true, mode: 0o700 }) |
| 641 | await fsAppendFile(filePath, data, { mode: 0o600 }) |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | private async drainWriteQueue(): Promise<void> { |
| 646 | for (const [filePath, queue] of this.writeQueues) { |
no test coverage detected