Fix time parsing from API default value
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
7b182bd898
commit
1d8dc2a072
1 changed files with 5 additions and 1 deletions
|
@ -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 {
|
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)
|
defer s.sv.Unsubscribe(events)
|
||||||
for e := range events {
|
for e := range events {
|
||||||
if err := stream.Send(&types.Event{
|
if err := stream.Send(&types.Event{
|
||||||
|
|
Loading…
Reference in a new issue