We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3c812c2 + 15d0a31 commit 7ebe750Copy full SHA for 7ebe750
.DS_Store
-8 KB
.claude/CLAUDE.md
cmd/goose/ratelimit.go
@@ -36,7 +36,10 @@ func (r *RateLimiter) Allow() bool {
36
tokensToAdd := int(elapsed / r.refillRate)
37
38
if tokensToAdd > 0 {
39
- r.tokens = minInt(r.tokens+tokensToAdd, r.maxTokens)
+ r.tokens += tokensToAdd
40
+ if r.tokens > r.maxTokens {
41
+ r.tokens = r.maxTokens
42
+ }
43
r.lastRefill = now
44
}
45
@@ -48,11 +51,3 @@ func (r *RateLimiter) Allow() bool {
48
51
49
52
return false
50
53
-
-// minInt returns the minimum of two integers.
-func minInt(a, b int) int {
54
- if a < b {
55
- return a
56
- }
57
- return b
58
-}
0 commit comments