Default events since to current time

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 74c12aa429)
This commit is contained in:
Brian Goff
2015-06-10 10:38:33 -07:00
committed by Jessica Frazelle
parent 5291de79ae
commit 1d3f7cc012
4 changed files with 19 additions and 0 deletions
+4
View File
@@ -398,6 +398,7 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
until = u
}
timer := time.NewTimer(0)
timer.Stop()
if until > 0 {
@@ -456,6 +457,9 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
current, l := es.Subscribe()
if since == -1 {
current = nil
}
defer es.Evict(l)
for _, ev := range current {
if ev.Time < since {