Fix time parsing from API default value

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-12 13:29:53 -08:00
parent 7b182bd898
commit 1d8dc2a072

View file

@ -271,7 +271,11 @@ func (s *apiServer) UpdateProcess(ctx context.Context, r *types.UpdateProcessReq
}
func (s *apiServer) Events(r *types.EventsRequest, stream types.API_EventsServer) error {
events := s.sv.Events(time.Unix(int64(r.Timestamp), 0))
t := time.Time{}
if r.Timestamp != 0 {
t = time.Unix(int64(r.Timestamp), 0)
}
events := s.sv.Events(t)
defer s.sv.Unsubscribe(events)
for e := range events {
if err := stream.Send(&types.Event{