fix(db): keep the Postgres pool across a restore

The reopen after a restore closed the ORM's pool and waited for it to end.
Ending a pg pool waits for every connection it has lent out, and one lent
to a job while the restore ran was never handed back, so the restore
request never returned and every later query failed on a destroyed driver.
A Postgres restore replaces the contents of the same database, so the pool
now stays and the reopen only migrates; SQLite still reconnects around its
swapped file.
This commit is contained in:
Isaias Tavares
2026-11-03 09:06:41 -03:00
parent c72b680fec
commit 3f1a786313
5 changed files with 54 additions and 8 deletions
@@ -14,6 +14,7 @@ import type { EntityManager } from '@mikro-orm/core';
*/
export class SqliteEngine implements DatabaseEngine {
readonly id = 'sqlite';
readonly reopenSwapsConnection = true;
describe(): string {
return `SQLite file ${resolveDbPath()}`;