Make shutdown docs compilable (#330)
This commit is contained in:
committed by
Kamil Kisiel
parent
53c1911da2
commit
0b74e3d0fe
@@ -436,7 +436,8 @@ func main() {
|
|||||||
<-c
|
<-c
|
||||||
|
|
||||||
// Create a deadline to wait for.
|
// Create a deadline to wait for.
|
||||||
ctx, cancel := context.WithTimeout(ctx, wait)
|
ctx, cancel := context.WithTimeout(context.Background(), wait)
|
||||||
|
defer cancel()
|
||||||
// Doesn't block if no connections, but will otherwise wait
|
// Doesn't block if no connections, but will otherwise wait
|
||||||
// until the timeout deadline.
|
// until the timeout deadline.
|
||||||
srv.Shutdown(ctx)
|
srv.Shutdown(ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user