Tentative fix for websocket timeout

This commit is contained in:
sfigato 2023-03-14 18:37:49 +01:00
parent 463540be75
commit 0a071a2285
Signed by: blallo
GPG Key ID: C530464EEDCF489A

View File

@ -50,7 +50,14 @@ func (h *livenessHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
<-ticker.C <-ticker.C
timer := time.NewTimer(livenessTimeout) timer := time.NewTimer(livenessTimeout)
select { 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{ h.logger.Warn(map[string]any{
"msg": "Liveness request timed out", "msg": "Liveness request timed out",
"context": "ws", "context": "ws",