diff --git a/cmd/broadcast/ws_handler.go b/cmd/broadcast/ws_handler.go index c8a3633..d18a553 100644 --- a/cmd/broadcast/ws_handler.go +++ b/cmd/broadcast/ws_handler.go @@ -50,7 +50,14 @@ func (h *livenessHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { <-ticker.C timer := time.NewTimer(livenessTimeout) select { - case <-timer.C: + case <-r.Context().Done(): + h.logger.Warn(map[string]any{ + "msg": "Liveness context canceled", + "context": "ws", + "err": r.Context().Err(), + }) + return + case <-ticker.C: h.logger.Warn(map[string]any{ "msg": "Liveness request timed out", "context": "ws",