From 3ffca722e3cac3f6d0303691c19f202ebbc502e3 Mon Sep 17 00:00:00 2001 From: DJP Date: Thu, 30 Apr 2026 13:53:27 -0400 Subject: [PATCH] Move bootSql import to top of server/index.ts ESM hoists imports anyway but a mid-file `import` statement reads as a foot-gun on review. No behaviour change; rules out one variable while diagnosing a prod boot crash. Co-Authored-By: Claude Opus 4.7 (1M context) --- v2/server/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/server/index.ts b/v2/server/index.ts index ff1f2a3..88aaf97 100644 --- a/v2/server/index.ts +++ b/v2/server/index.ts @@ -26,6 +26,7 @@ import { handleDashboardServe, handleQaSignoff, handleBuildReport, handleReportDataset, handleRetryReport, handleCancelReport, } from './routes/reports.js'; +import { sql as bootSql } from './db/client.js'; assertComposeNameOrExit(); @@ -192,7 +193,6 @@ const server = createServer(async (req, res) => { // killed the previous server (deploy, OOM, manual restart). Without this they // keep polling forever in the UI ("running for 14h") and the run/retry guard // thinks one is still in flight, blocking new triggers. -import { sql as bootSql } from './db/client.js'; async function sweepOrphans(): Promise { try { const rows = await bootSql>`