mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-26 17:51:49 +01:00
added comment
This commit is contained in:
parent
82e4174073
commit
d7750ad15f
@ -235,9 +235,14 @@ func (s *Server) handleWebsocket(w http.ResponseWriter, r *http.Request) {
|
||||
if advancedQuerier != nil {
|
||||
advancedQuerier.AfterQuery(events, filter)
|
||||
}
|
||||
|
||||
// this block should not trigger if the SQL query accounts for filter.Limit
|
||||
// other implementations may be broken, and this ensures the client
|
||||
// won't be bombarded.
|
||||
if filter.Limit > 0 && len(events) > filter.Limit {
|
||||
events = events[0:filter.Limit]
|
||||
}
|
||||
|
||||
for _, event := range events {
|
||||
ws.WriteJSON([]interface{}{"EVENT", id, event})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user