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

@@ -1,6 +1,7 @@
package logic
import (
"errors"
"fmt"
"os"
"strconv"
@@ -320,6 +321,10 @@ func (p *ProcessBase) initPsutil() {
}
func (p *ProcessBase) Kill() error {
if p.State.State != eum.ProcessStateRunning {
return errors.New("can't kill not running process")
}
p.State.manualStopFlag = true
p.op.Signal(syscall.SIGINT)
select {
case <-p.StopChan: