optimal process state

This commit is contained in:
akrike
2025-08-29 17:25:23 +08:00
parent 0d46bb7d07
commit da54e71c27
7 changed files with 26 additions and 14 deletions

View File

@@ -37,7 +37,7 @@ func (p *processCtlLogic) KillProcess(uuid int) error {
if !ok {
return errors.New("进程类型错误")
}
if result.State.State != eum.ProcessStateStart {
if result.State.State != eum.ProcessStateRunning {
return nil
}
result.State.manualStopFlag = true
@@ -61,7 +61,7 @@ func (p *processCtlLogic) KillAllProcess() {
wg := sync.WaitGroup{}
p.processMap.Range(func(key, value any) bool {
process := value.(*ProcessBase)
if process.State.State != eum.ProcessStateStart {
if process.State.State != eum.ProcessStateRunning {
return true
}
wg.Add(1)