diff --git a/cmd/apps/chat/chat.go b/cmd/apps/chat/chat.go index 6f1f63ee34..a1dbee6d44 100644 --- a/cmd/apps/chat/chat.go +++ b/cmd/apps/chat/chat.go @@ -131,10 +131,10 @@ func sseHandler(w http.ResponseWriter, req *http.Request) { } clientChan = make(chan string) + go func() { <-req.Context().Done() close(clientChan) - clientChan = nil log.Println("SSE connection were closed.") }()