Skip to content

Commit

Permalink
use procKilledCh instead of procKilledCh
Browse files Browse the repository at this point in the history
  • Loading branch information
xiantang committed Jun 23, 2024
1 parent d423761 commit e379ed5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions runner/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type Engine struct {
binStopCh chan bool
exitCh chan bool

cleanupWg sync.WaitGroup
procKillWg sync.WaitGroup
mu sync.RWMutex
watchers uint
round uint64
Expand Down Expand Up @@ -481,7 +481,7 @@ func (e *Engine) runPostCmd() error {
}

func (e *Engine) runBin() error {
e.cleanupWg.Add(1)
e.procKillWg.Add(1)
killFunc := func(cmd *exec.Cmd, stdout io.ReadCloser, stderr io.ReadCloser, killCh chan struct{}, processExit chan struct{}, wg *sync.WaitGroup) {
defer wg.Done()
select {
Expand Down Expand Up @@ -575,7 +575,7 @@ func (e *Engine) runBin() error {
default:
e.runnerLog("Process Exit with Code: %v", state.ExitCode())
}
e.cleanupWg.Done()
e.procKillWg.Done()

if !e.config.Build.Rerun {
return
Expand Down Expand Up @@ -625,7 +625,7 @@ func (e *Engine) cleanup() {
}

e.mainDebug("waiting for exit...")
e.cleanupWg.Wait()
e.procKillWg.Wait()
e.running = false
e.mainDebug("exited")
}
Expand Down

0 comments on commit e379ed5

Please sign in to comment.