tbh i forgot
This commit is contained in:
12
main.go
12
main.go
@@ -72,14 +72,12 @@ func main() {
|
||||
fmt.Print("\r")
|
||||
|
||||
// shutdown
|
||||
context, cancel := context.WithTimeout(context.Background(), 2*time.Second)
|
||||
// known issue: sse blocks shutdown if a client is still connected
|
||||
context, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
if err = server.Shutdown(context); err != nil {
|
||||
backend.LogLine("Graceful Shutdown failed", 4)
|
||||
}
|
||||
if err = serverSecure.Shutdown(context); err != nil {
|
||||
backend.LogLine("Graceful Shutdown failed", 4)
|
||||
}
|
||||
server.Shutdown(context)
|
||||
serverSecure.Shutdown(context)
|
||||
|
||||
backend.LogLine("Stopped", 2)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user