Added license. Cleanup and expanded documentation.
This commit is contained in:
parent
d35cf1d8a6
commit
86774ae781
6 changed files with 118 additions and 60 deletions
2
main.go
2
main.go
|
|
@ -52,9 +52,9 @@ func main() {
|
|||
}()
|
||||
|
||||
// Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds.
|
||||
// Use a buffered channel to avoid missing signals as recommended for signal.Notify
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, os.Interrupt)
|
||||
signal.Notify(quit, os.Kill)
|
||||
<-quit
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
defer cancel()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue