Send resp immediately on GET /events

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2015-07-02 11:45:24 -04:00
parent 358c022cac
commit d0a299c027
2 changed files with 32 additions and 1 deletions
+3 -1
View File
@@ -430,7 +430,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
d := s.daemon
es := d.EventsService
w.Header().Set("Content-Type", "application/json")
enc := json.NewEncoder(ioutils.NewWriteFlusher(w))
outStream := ioutils.NewWriteFlusher(w)
outStream.Write(nil) // make sure response is sent immediately
enc := json.NewEncoder(outStream)
getContainerId := func(cn string) string {
c, err := d.Get(cn)