Default events since to current time

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
Brian Goff
2015-06-10 12:37:40 -04:00
parent 55bdb51659
commit 74c12aa429
4 changed files with 23 additions and 7 deletions
+4
View File
@@ -395,6 +395,7 @@ func (s *Server) getEvents(version version.Version, w http.ResponseWriter, r *ht
}
until = u
}
timer := time.NewTimer(0)
timer.Stop()
if until > 0 {
@@ -453,6 +454,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 {