From e22aa79f1bf3650ea51f03979bb693f4f7ac70a0 Mon Sep 17 00:00:00 2001 From: Owen Date: Thu, 10 Sep 2026 16:00:19 -0400 Subject: [PATCH] Add explicit process exit to prevent hanging in migrations script --- server/setup/migrationsPg.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/setup/migrationsPg.ts b/server/setup/migrationsPg.ts index ed7c7f9fd..8f65756dc 100644 --- a/server/setup/migrationsPg.ts +++ b/server/setup/migrationsPg.ts @@ -66,6 +66,12 @@ const migrations = [ await run(); +// The pg Pool is created with allowExitOnIdle: false (see poolConfig.ts) so +// its sockets keep the event loop alive even when idle. Without an explicit +// exit here, this one-shot script would hang until the pool's +// idleTimeoutMillis elapses before the process could terminate. +process.exit(0); + async function run() { // run the migrations await runMigrations();