Skip to content

Commit

Permalink
Update to have ShowAndRun() called from main goroutine
Browse files Browse the repository at this point in the history
  • Loading branch information
lucor committed Apr 23, 2020
1 parent e8f1dab commit c10a72e
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,21 @@ func main() {
}
}()

go osApp.ShowAndRun()
for {
select {
case st := <-statChan:
osApp.RefreshStats(st)
case sig := <-sigChan:
log.Raw("\n")
log.Important("Got signal: %v", sig)
log.Info("Shutting down grpc server...")
server.Stop()
log.Info("All done, bye")
os.Exit(0)
go func() {
for {
select {
case st := <-statChan:
osApp.RefreshStats(st)
case sig := <-sigChan:
log.Raw("\n")
log.Important("Got signal: %v", sig)
log.Info("Shutting down grpc server...")
server.Stop()
log.Info("All done, bye")
os.Exit(0)
}
}
}
}()

osApp.ShowAndRun()
}

0 comments on commit c10a72e

Please sign in to comment.