|
|
@@ -1673,6 +1673,11 @@ func main() {
|
|
|
if err := srv.Shutdown(ctx); err != nil {
|
|
|
log.Fatal("Server Shutdown:", err)
|
|
|
}
|
|
|
+ // catching ctx.Done(). timeout of 5 seconds.
|
|
|
+ select {
|
|
|
+ case <-ctx.Done():
|
|
|
+ log.Println("timeout of 5 seconds.")
|
|
|
+ }
|
|
|
log.Println("Server exiting")
|
|
|
}
|
|
|
```
|