全新的进程控制动作状态机
This commit is contained in:
@@ -27,7 +27,7 @@ func IsRunning() bool {
|
||||
log.Printf("[WARN] ProcessManager.Status() 失败: %v,降级到 PID 文件", err)
|
||||
return isRunningLegacy()
|
||||
}
|
||||
return status.State == "running"
|
||||
return status.Phase == "RUNNING"
|
||||
}
|
||||
return isRunningLegacy()
|
||||
}
|
||||
@@ -77,7 +77,7 @@ func GetStatus() (map[string]interface{}, error) {
|
||||
return nil, err
|
||||
}
|
||||
return map[string]interface{}{
|
||||
"state": status.State,
|
||||
"state": status.Phase,
|
||||
"pid": status.PID,
|
||||
"port": status.Port,
|
||||
}, nil
|
||||
@@ -104,7 +104,7 @@ func Reload() error {
|
||||
return err
|
||||
}
|
||||
|
||||
if status.State != "running" {
|
||||
if status.Phase != "RUNNING" {
|
||||
return pm.Start(context.Background())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user