Skip to content

Commit

Permalink
feat(rate): add method LastTouch (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
xyy0411 committed Aug 19, 2024
1 parent d14d8f3 commit 8db256a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extension/rate/rate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func NewLimiter(interval time.Duration, burst int) *Limiter {
}
}

// LastTouch ...
func (lim *Limiter) LastTouch() int64 {
return lim.lastTime.Unix()
}

// Acquire ...
func (lim *Limiter) Acquire() bool {
return lim.AcquireN(1)
Expand Down

0 comments on commit 8db256a

Please sign in to comment.