fix(run.go): use a non-blocking channel receive
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
adding the started channel and receiving in a blocking fashion meant the program flow never got to blocking on the quit channel after setting up signal intercepts. this commit turns the blocking receive on `started` to a non-blocking one.
This commit is contained in:
parent
d5ed25f1f1
commit
1ba95c3d37
11
run.go
11
run.go
@ -169,9 +169,14 @@ func run() error {
|
||||
started <- err
|
||||
}(started)
|
||||
|
||||
err = <-started
|
||||
if err != nil {
|
||||
return err
|
||||
// non-blocking channel receive.
|
||||
select {
|
||||
case err := <-started:
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
quit := make(chan os.Signal, 1)
|
||||
|
Loading…
Reference in New Issue
Block a user