(filePath: string, data: string)
| 646 | } |
| 647 | |
| 648 | private async appendToFile(filePath: string, data: string): Promise<void> { |
| 649 | try { |
| 650 | await fsAppendFile(filePath, data, { mode: 0o600 }) |
| 651 | } catch { |
| 652 | // Directory may not exist — some NFS-like filesystems return |
| 653 | // unexpected error codes, so don't discriminate on code. |
| 654 | await mkdir(dirname(filePath), { recursive: true, mode: 0o700 }) |
| 655 | await fsAppendFile(filePath, data, { mode: 0o600 }) |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | private async drainWriteQueue(): Promise<void> { |
| 660 | for (const [filePath, queue] of this.writeQueues) { |
no test coverage detected