refactor: decomposition WIP (orchestrator/server/execution-plan)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhFXmKe4WisSSPf9LrmmTg
This commit is contained in:
+4
-3
@@ -154,9 +154,6 @@ class DefaultModelManager(
|
||||
private suspend fun waitForHealthy(process: LlamaProcess): Boolean {
|
||||
val endTime = Clock.System.now().toEpochMilliseconds() + healthTimeoutMs
|
||||
while (Clock.System.now().toEpochMilliseconds() < endTime) {
|
||||
// A crashed process (bad --model, port clash) never gets healthy; polling the full
|
||||
// timeout is pure dead time. Bail as soon as it's gone.
|
||||
if (!process.isAlive) return false
|
||||
try {
|
||||
val response = httpClient.get("http://$host:$port/health").body<String>()
|
||||
if (response.contains("\"status\":\"healthy\"") || response.contains("ok")) {
|
||||
@@ -165,6 +162,10 @@ class DefaultModelManager(
|
||||
} catch (_: Exception) {
|
||||
// Continue polling
|
||||
}
|
||||
// A crashed process (bad --model, port clash) never gets healthy; polling the full
|
||||
// timeout is pure dead time. Bail as soon as it's gone — but only after probing health,
|
||||
// so a server that's already answering isn't missed on a lost startup/exit race.
|
||||
if (!process.isAlive) return false
|
||||
delay(POLL_INTERVAL)
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user