Skip to content

Commit

Permalink
Remove wrong/unecessary comment
Browse files Browse the repository at this point in the history
  • Loading branch information
doingodswork committed Mar 27, 2020
1 parent 985d31a commit 68f9328
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Expand Up @@ -193,9 +193,7 @@ func main() {
sig := <-c
log.Printf("Received signal %v, shutting down...\n", sig)
*stoppingPtr = true
// Create a deadline to wait for.
// Using the same value as the server's `WriteTimeout` would be great, because this would mean that every client could finish his request as he normally could.
// But `docker stop` only gives us 10 seconds.
// Create a deadline to wait for. `docker stop` gives us 10 seconds.
// No need to get the cancel func and defer calling it, because srv.Shutdown() will consider the timeout from the context.
ctx, _ := context.WithTimeout(context.Background(), 9*time.Second)
// Doesn't block if no connections, but will otherwise wait until the timeout deadline
Expand Down

0 comments on commit 68f9328

Please sign in to comment.