Skip to content

Commit

Permalink
chore(log):add more log output
Browse files Browse the repository at this point in the history
  • Loading branch information
seymourtang committed Dec 21, 2023
1 parent 2ee1c5f commit fe5ac95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ func loop(ctx context.Context, notification chan<- Event) {
if resp != nil && len(resp.Data) > 0 {
slog.Info("found the events", "num", len(resp.Data), "events", resp.Data)
lastTs = resp.Data[0].StartAt
if time.Since(time.UnixMilli(lastTs)) < 30*time.Minute {
tt := time.UnixMilli(lastTs)
if time.Since(tt) <= 30*time.Minute {
notification <- resp.Data[0]
} else {
slog.Info("the latest event is out of date", "startAt", tt.String(), "event", resp.Data[0])
}
} else {
slog.Info("no event found")
}
}
case <-ctx.Done():
Expand Down

0 comments on commit fe5ac95

Please sign in to comment.