Write diagnostics to temporary location when database isn't ready

This commit is contained in:
Michael B. Gale
2026-10-09 19:29:16 +01:00
parent bf28f43414
commit ed5bb3c5a3
5 changed files with 253 additions and 163 deletions

View File

@@ -40,7 +40,7 @@ import {
addDiagnostic,
addNoLanguageDiagnostic,
flushDiagnostics,
logUnwrittenDiagnostics,
logTemporaryDiagnostics,
makeDiagnostic,
makeTelemetryDiagnostic,
} from "./diagnostics";
@@ -484,6 +484,7 @@ async function run(
if (statusReportBase !== undefined) {
await sendStatusReport(statusReportBase);
}
logTemporaryDiagnostics();
return;
}
@@ -766,8 +767,8 @@ async function run(
);
}
// Write diagnostics to the database that we previously stored in memory because the database
// did not exist until now.
// Move diagnostics to the database that we previously kept in a temporary location
// because the database did not exist until now
flushDiagnostics(config);
// We save the config here instead of at the end of `initConfig` because we
@@ -797,7 +798,7 @@ async function run(
);
return;
} finally {
logUnwrittenDiagnostics();
logTemporaryDiagnostics();
}
await sendCompletedStatusReport(
startedAt,