We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9faca53 commit 103410eCopy full SHA for 103410e
server/sse.go
@@ -283,7 +283,12 @@ func (s *SSEServer) handleSSE(w http.ResponseWriter, r *http.Request) {
283
for {
284
select {
285
case <-ticker.C:
286
- session.eventQueue <- fmt.Sprintf(":ping - %s\n\n", time.Now().Format(time.RFC3339))
+ select {
287
+ case session.eventQueue <- fmt.Sprintf(":ping - %s\n\n", time.Now().Format(time.RFC3339)):
288
+ // Ping sent successfully
289
+ default:
290
+ log.Printf("Keep-alive ping dropped: event queue is full")
291
+ }
292
case <-session.done:
293
return
294
case <-r.Context().Done():
0 commit comments