()
| 21 | } |
| 22 | |
| 23 | export function closeAll(): void { |
| 24 | for (const db of connections.values()) { |
| 25 | try { |
| 26 | db.close(); |
| 27 | } catch (err) { |
| 28 | // Cleanup path — keep closing the rest, but surface DB-locked/corruption signals. |
| 29 | logger.debug('sqlite close failed', { err }); |
| 30 | } |
| 31 | } |
| 32 | connections.clear(); |
| 33 | } |