Allow rebuilds on autoscaling-managed servers

This commit is contained in:
2026-10-08 00:01:31 -04:00
parent e514d21b74
commit 592e829fec
3 changed files with 87 additions and 2 deletions
+2 -1
View File
@@ -121,7 +121,8 @@ export function releaseRestartRequest(server: string, source: RestartSource): vo
export function requestLifecycle(server: string, action: RuntimeAction) {
if (!runtimeActions.includes(action)) return { ok: false as const, status: 400, error: 'Choose start, restart, rebuild, or stop.' };
const owned = action !== 'restart' ? scalingOwnershipBlocker(server) : null;
// Restart and rebuild preserve the lineup; their pending work holds scaling decisions.
const owned = action === 'start' || action === 'stop' ? scalingOwnershipBlocker(server) : null;
if (owned) return { ok: false as const, status: 409, error: owned };
if (!nativeInstance(server) && !unplacedNativeCreation(server)) return { ok: false as const, status: 503, error: 'Server has no native host instance.' };
return db().transaction(() => {