No need to explicitly call Stop() on runner loops
Once the context is canceled, the loops will exit, so there is no need to explicitly Stop(). We just need to Wait() for the loops to exit.
This commit is contained in:
parent
d5f5524934
commit
72ec1bf68f
1 changed files with 1 additions and 5 deletions
|
|
@ -172,11 +172,7 @@ func main() {
|
|||
if err := srv.Shutdown(shutdownCtx); err != nil {
|
||||
log.Printf("graceful api server shutdown failed: %+v", err)
|
||||
}
|
||||
log.Printf("stopping runner loop")
|
||||
if err := runner.Stop(); err != nil {
|
||||
log.Printf("failed to shutdown workers: %+v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
log.Printf("waiting for runner to stop")
|
||||
if err := runner.Wait(); err != nil {
|
||||
log.Printf("failed to shutdown workers: %+v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue