diff --git a/internal/process/manager.go b/internal/process/manager.go index d86ca2c..fb64750 100644 --- a/internal/process/manager.go +++ b/internal/process/manager.go @@ -858,9 +858,10 @@ func (pm *ProcessManager) computeState(pid int, result PortCheckResult) ProcessS return state } - // 3. 启动超时 - if time.Since(pm.startTime) > StartupTimeout && pm.currentPhase != PhaseReloading { - log.Printf("[DEBUG] computeState: 启动超时, startTime=%v, elapsed=%v", pm.startTime, time.Since(pm.startTime)) + // 3. 启动超时(只对 STARTING 状态生效) + if pm.currentPhase == PhaseStarting && time.Since(pm.startTime) > StartupTimeout { + log.Printf("[DEBUG] computeState: 启动超时, startTime=%v, elapsed=%v", + pm.startTime, time.Since(pm.startTime)) state.Error = fmt.Sprintf("启动超时 (超过 %v)", StartupTimeout) if portErr != nil { state.Error += ": " + portErr.Error()