@@ -27,7 +27,6 @@ type Engine struct {
27
27
watcherStopCh chan bool
28
28
buildRunCh chan bool
29
29
buildRunStopCh chan bool
30
- canExit chan bool
31
30
binStopCh chan bool
32
31
exitCh chan bool
33
32
@@ -56,7 +55,6 @@ func NewEngineWithConfig(cfg *Config, debugMode bool) (*Engine, error) {
56
55
watcherStopCh : make (chan bool , 10 ),
57
56
buildRunCh : make (chan bool , 1 ),
58
57
buildRunStopCh : make (chan bool , 1 ),
59
- canExit : make (chan bool , 1 ),
60
58
binStopCh : make (chan bool ),
61
59
exitCh : make (chan bool ),
62
60
fileChecksums : & checksumMap {m : make (map [string ]string )},
@@ -374,19 +372,16 @@ func (e *Engine) buildRun() {
374
372
select {
375
373
case <- e .buildRunStopCh :
376
374
return
377
- case <- e .canExit :
378
375
default :
379
376
}
380
377
var err error
381
378
if err = e .runPreCmd (); err != nil {
382
- e .canExit <- true
383
379
e .runnerLog ("failed to execute pre_cmd: %s" , err .Error ())
384
380
if e .config .Build .StopOnError {
385
381
return
386
382
}
387
383
}
388
384
if err = e .building (); err != nil {
389
- e .canExit <- true
390
385
e .buildLog ("failed to build, error: %s" , err .Error ())
391
386
_ = e .writeBuildErrorLog (err .Error ())
392
387
if e .config .Build .StopOnError {
@@ -399,7 +394,6 @@ func (e *Engine) buildRun() {
399
394
return
400
395
case <- e .exitCh :
401
396
e .mainDebug ("exit in buildRun" )
402
- close (e .canExit )
403
397
return
404
398
default :
405
399
}
@@ -521,7 +515,6 @@ func (e *Engine) runBin() error {
521
515
case <- e .exitCh :
522
516
e .mainDebug ("exit in runBin" )
523
517
wg .Wait ()
524
- close (e .canExit )
525
518
default :
526
519
}
527
520
}()
@@ -595,7 +588,6 @@ func (e *Engine) cleanup() {
595
588
596
589
e .mainDebug ("waiting for exit..." )
597
590
598
- <- e .canExit
599
591
e .running = false
600
592
e .mainDebug ("exited" )
601
593
}
0 commit comments