This commit is contained in:
lzh
2025-08-29 17:02:00 +08:00
parent cffb1ee0f4
commit 0d46bb7d07
7 changed files with 10 additions and 8 deletions

View File

@@ -281,7 +281,7 @@ func (p *ProcessBase) monitorHanler() {
ticker := time.NewTicker(time.Second * time.Duration(config.CF.PerformanceInfoInterval))
defer ticker.Stop()
for {
if p.State.State != 1 {
if p.State.State != eum.ProcessStateStart {
log.Logger.Debugw("进程未在运行", "state", p.State.State)
return
}

View File

@@ -37,7 +37,7 @@ func (p *processCtlLogic) KillProcess(uuid int) error {
if !ok {
return errors.New("进程类型错误")
}
if result.State.State != 1 {
if result.State.State != eum.ProcessStateStart {
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 != 1 {
if process.State.State != eum.ProcessStateStart {
return true
}
wg.Add(1)

View File

@@ -39,7 +39,7 @@ func (p *ProcessPty) Start() (err error) {
}
}()
if ok := p.SetState(eum.ProcessStateStart, func() bool {
return p.State.State != 1
return p.State.State != eum.ProcessStateStart
}); !ok {
log.Logger.Warnw("进程已在运行,跳过启动")
return nil

View File

@@ -46,7 +46,7 @@ func (p *ProcessStd) Start() (err error) {
}
}()
if ok := p.SetState(eum.ProcessStateStart, func() bool {
return p.State.State != 1
return p.State.State != eum.ProcessStateStart
}); !ok {
log.Logger.Warnw("进程已在运行,跳过启动")
return nil