Skip to content

Commit e01ca57

Browse files
authored
[common-go] Add doc on refillInterval (#16973)
1 parent 118da26 commit e01ca57

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/common-go/grpc/ratelimit.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ type keyFunc func(req interface{}) (string, error)
2626

2727
// RateLimit configures the reate limit for a function
2828
type RateLimit struct {
29-
Block bool `json:"block"`
30-
BucketSize uint `json:"bucketSize"`
29+
Block bool `json:"block"`
30+
BucketSize uint `json:"bucketSize"`
31+
// RefillInterval is the rate at which a new token gets added to the bucket.
32+
// Note that this does _not_ completely refill the bucket, only one token gets added,
33+
// so effectively this is the rate at which requests can be made.
3134
RefillInterval util.Duration `json:"refillInterval"`
3235

3336
KeyCacheSize uint `json:"keyCacheSize,omitempty"`

0 commit comments

Comments
 (0)