We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4dbbb4a commit db6bb65Copy full SHA for db6bb65
limit/token_bucket.go
@@ -12,6 +12,7 @@ func NewTokenBucket(maxCount int64,interval time.Duration)*TokenBucket {
12
t := TokenBucket{}
13
t.tokenPool = make(chan bool,maxCount)
14
go func() {
15
+ // it mean how many time per time.
16
ti := time.NewTicker(time.Duration(interval.Nanoseconds()/(maxCount*1000*1000))* time.Millisecond)
17
for {
18
select {
0 commit comments