tbh i forgot

This commit is contained in:
Maximilian Wagner
2025-12-27 19:22:51 +01:00
parent 9e65bd3916
commit b600ec5267
6 changed files with 43 additions and 48 deletions

12
main.go
View File

@@ -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)
}