edit process kill

This commit is contained in:
akrike
2025-08-29 17:34:16 +08:00
parent da54e71c27
commit f723c12d42
3 changed files with 5 additions and 10 deletions

View File

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