mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
Flush headers before potentially blocking
This commit is contained in:
parent
ee05e12480
commit
cfae06db65
@ -459,6 +459,11 @@ func restGetEvents(w http.ResponseWriter, r *http.Request) {
|
|||||||
since, _ := strconv.Atoi(sinceStr)
|
since, _ := strconv.Atoi(sinceStr)
|
||||||
limit, _ := strconv.Atoi(limitStr)
|
limit, _ := strconv.Atoi(limitStr)
|
||||||
|
|
||||||
|
// Flush before blocking, to indicate that we've received the request
|
||||||
|
// and that it should not be retried.
|
||||||
|
f := w.(http.Flusher)
|
||||||
|
f.Flush()
|
||||||
|
|
||||||
evs := eventSub.Since(since, nil)
|
evs := eventSub.Since(since, nil)
|
||||||
if 0 < limit && limit < len(evs) {
|
if 0 < limit && limit < len(evs) {
|
||||||
evs = evs[len(evs)-limit:]
|
evs = evs[len(evs)-limit:]
|
||||||
|
Loading…
Reference in New Issue
Block a user