mirror of
https://github.com/lzh-1625/go_process_manager.git
synced 2025-10-05 16:06:51 +08:00
optimal process state
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user