feat(FN-4025): defer database integrity check and expose via health endpoin
Exposes database health status via the API by deferring integrity checks asynchronously, with docs and tests covering the core DB layer, store integration, and dashboard server health endpoint. Fusion-Task-Id: FN-4025
This commit is contained in:
@@ -1052,10 +1052,12 @@ export function createServer(store: TaskStore, options?: ServerOptions): ReturnT
|
||||
}
|
||||
|
||||
app.get("/api/health", (_req, res) => {
|
||||
const database = store.getDatabaseHealth();
|
||||
res.json({
|
||||
status: "ok",
|
||||
status: database.corruptionDetected ? "degraded" : "ok",
|
||||
version: cliPackageVersion,
|
||||
uptime: Math.floor(process.uptime()),
|
||||
database,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user