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) <noreply@anthropic.com>
This commit is contained in:
DJP 2026-04-30 13:53:27 -04:00
parent 98bcae6f31
commit 3ffca722e3

View file

@ -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<void> {
try {
const rows = await bootSql<Array<{ id: string }>>`