Skip to content

Commit

Permalink
provider/pd: include scheduleTime on check-in early/late errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Oct 18, 2024
1 parent 9d3a9dd commit 5d4bc85
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/pd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (c *client) CheckIn(ctx context.Context, check config.Check) (time.Time, er
// We are early to check-in
diff := scheduleTime.Sub(now)
if diff > tolerance {
err = fmt.Errorf("check-in not allowed for %v", diff)
err = fmt.Errorf("%v check-in not allowed for %v", scheduleTime.Format("15:04"), diff)
logger.Warn().Log(err.Error())
return time.Time{}, err
}
Expand All @@ -158,7 +158,7 @@ func (c *client) CheckIn(ctx context.Context, check config.Check) (time.Time, er
// We are late to check-in
diff := now.Sub(scheduleTime)
if diff > tolerance {
err = fmt.Errorf("check-in is late by %v", diff-tolerance)
err = fmt.Errorf("%v check-in is late by %v", scheduleTime.Format("15:04"), diff-tolerance)
logger.Warn().Log(err.Error())
return time.Time{}, err
}
Expand Down

0 comments on commit 5d4bc85

Please sign in to comment.