Skip to content

Commit

Permalink
fix token used to recursive getEvents function #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Gaunet committed May 11, 2022
1 parent 1db1197 commit 052d4b6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func (a *App) getEvents(context context.Context, groupName string, streamName st
return err
}

if len(res.Events) == 0 {
a.appLog.Debugln("NO event")
return nil
}
// if len(res.Events) == 0 {
// a.appLog.Debugln("NO event")
// return nil
// }
for _, k := range res.Events {
var lineOfLog fluentDockerLog
err := json.Unmarshal([]byte(*k.Message), &lineOfLog)
Expand All @@ -115,7 +115,10 @@ func (a *App) getEvents(context context.Context, groupName string, streamName st
a.appLog.Infof("%s -- %s -- %s ", timeT, lineOfLog.Kubernetes.ContainerName, lineOfLog.Log)
}

if *res.NextForwardToken != nextToken {
// fmt.Println(nextToken)
// fmt.Println(*res.NextForwardToken)
// fmt.Println(*res.NextBackwardToken)
if *res.NextBackwardToken != nextToken {
return a.getEvents(context, groupName, streamName, client, minTimeStamp, maxTimeStamp, *res.NextBackwardToken)
}
return nil
Expand Down

0 comments on commit 052d4b6

Please sign in to comment.