Filter stream events before queueing them
This commit is contained in:
@@ -55,7 +55,7 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
|
||||
w.Header().Set("Cache-Control", "no-cache")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
||||
live := s.hub.subscribe()
|
||||
live := s.hub.subscribe(wanted)
|
||||
defer s.clientsChanged()
|
||||
defer s.hub.unsubscribe(live)
|
||||
s.clientsChanged()
|
||||
@@ -96,9 +96,6 @@ func (s *Server) StreamEvents(w http.ResponseWriter, r *http.Request, params api
|
||||
if ev.Seq != 0 && ev.Seq <= last {
|
||||
continue
|
||||
}
|
||||
if !wanted(ev) {
|
||||
continue
|
||||
}
|
||||
if !writeEvent(w, ev) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user