Tentative fix for websocket timeout
This commit is contained in:
parent
463540be75
commit
0a071a2285
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user