SSE reconnect, task switcher state/inbox/new task, stream throttle
This commit is contained in:
@@ -48,7 +48,7 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
|
||||
return
|
||||
}
|
||||
|
||||
ping := time.NewTicker(30 * time.Second)
|
||||
ping := time.NewTicker(15 * time.Second)
|
||||
defer ping.Stop()
|
||||
|
||||
for {
|
||||
@@ -68,7 +68,7 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
|
||||
}
|
||||
|
||||
case <-ping.C:
|
||||
_, err := fmt.Fprint(w, ": ping\n\n")
|
||||
_, err := fmt.Fprint(w, "event: ping\ndata: ping\n\n")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user