lib/api, lib/model: Fixes around event request tracking (#6774)

This commit is contained in:
Simon Frei
2020-06-25 21:48:48 +02:00
committed by GitHub
parent 80ada1bb6c
commit 4f06708330
4 changed files with 22 additions and 3 deletions
+4 -1
View File
@@ -1217,7 +1217,6 @@ func (s *service) postDBIgnores(w http.ResponseWriter, r *http.Request) {
}
func (s *service) getIndexEvents(w http.ResponseWriter, r *http.Request) {
s.fss.OnEventRequest()
mask := s.getEventMask(r.URL.Query().Get("events"))
sub := s.getEventSub(mask)
s.getEvents(w, r, sub)
@@ -1229,6 +1228,10 @@ func (s *service) getDiskEvents(w http.ResponseWriter, r *http.Request) {
}
func (s *service) getEvents(w http.ResponseWriter, r *http.Request, eventSub events.BufferedSubscription) {
if eventSub.Mask()&(events.FolderSummary|events.FolderCompletion) != 0 {
s.fss.OnEventRequest()
}
qs := r.URL.Query()
sinceStr := qs.Get("since")
limitStr := qs.Get("limit")
+2
View File
@@ -17,3 +17,5 @@ type mockedEventSub struct{}
func (s *mockedEventSub) Since(id int, into []events.Event, timeout time.Duration) []events.Event {
select {}
}
func (s *mockedEventSub) Mask() events.EventType { return 0 }