remove waring
This commit is contained in:
parent
d8f9858ea0
commit
35b8b3be57
1 changed files with 2 additions and 1 deletions
|
|
@ -18,12 +18,13 @@ func main() {
|
||||||
go func() {
|
go func() {
|
||||||
<-sig
|
<-sig
|
||||||
|
|
||||||
shutdownCtx, _ := context.WithTimeout(serverCtx, 30*time.Second)
|
shutdownCtx, cancel := context.WithTimeout(serverCtx, 30*time.Second)
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
<-shutdownCtx.Done()
|
<-shutdownCtx.Done()
|
||||||
if shutdownCtx.Err() == context.DeadlineExceeded {
|
if shutdownCtx.Err() == context.DeadlineExceeded {
|
||||||
log.Println("Shutdown timeout, force exit")
|
log.Println("Shutdown timeout, force exit")
|
||||||
|
cancel()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue