Show provisioning status during server creation

This commit is contained in:
2026-09-19 22:53:24 -04:00
parent 5985959882
commit 44b6415821
12 changed files with 72 additions and 12 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { freshStatusTimestamp } from '../../server-freshness.js';
export type Health = 'online' | 'stale' | 'offline' | 'starting';
export type Health = 'online' | 'stale' | 'offline' | 'starting' | 'provisioning';
const STALE_MAX_MS = 120_000;
+9
View File
@@ -0,0 +1,9 @@
import { db } from '../db/index.js';
/** Only the latest lifecycle operation can describe the current server. */
export function isProvisioning(server: string): boolean {
const operation = db().prepare(`SELECT action, state FROM server_deployments
WHERE server = ? ORDER BY rowid DESC LIMIT 1`).get(server) as
{ action: string; state: string } | undefined;
return operation?.action === 'create' && ['queued', 'running', 'awaiting-health'].includes(operation.state);
}