Skip to content

Commit

Permalink
use time.Now for Delay/RetryAfter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
molon committed Aug 19, 2024
1 parent 9162b04 commit 094ebe1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ratelimiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (r *Reservation) DelayFrom(t time.Time) time.Duration {
}

func (r *Reservation) Delay() time.Duration {
return r.DelayFrom(r.Now)
return r.DelayFrom(time.Now())
}

func (r *Reservation) RetryAfterFrom(t time.Time) time.Duration {
Expand All @@ -56,7 +56,7 @@ func (r *Reservation) RetryAfterFrom(t time.Time) time.Duration {
}

func (r *Reservation) RetryAfter() time.Duration {
return r.RetryAfterFrom(r.Now)
return r.RetryAfterFrom(time.Now())
}

type Driver interface {
Expand Down

0 comments on commit 094ebe1

Please sign in to comment.