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