Skip to content

Commit

Permalink
Merge pull request #1349 from openmeterio/fix-clock
Browse files Browse the repository at this point in the history
fix: strip monotonic clock reading from time returned by clock
  • Loading branch information
chrisgacsal authored Aug 13, 2024
2 parents 781aade + 54ee876 commit 8323eca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/clock/clock.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import "time"
var drift time.Duration

func Now() time.Time {
return time.Now().Add(-drift)
t := time.Now().Add(-drift)
return t.Round(0) // Remove monotonic time reading
}

func SetTime(t time.Time) time.Time {
Expand Down

0 comments on commit 8323eca

Please sign in to comment.