File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ type rateLimitedHTTPTransport struct {
12
12
}
13
13
14
14
func (t * rateLimitedHTTPTransport ) RoundTrip (req * http.Request ) (* http.Response , error ) {
15
- t .limiter .WaitCtx (req .Context ())
15
+ if err := t .limiter .WaitCtx (req .Context ()); err != nil {
16
+ return nil , err
17
+ }
16
18
return t .next .RoundTrip (req )
17
19
}
Original file line number Diff line number Diff line change 9
9
10
10
// fixed winow rate limiter: limit number of request allowed per time interval
11
11
// - keeps track of interval start and last call time
12
- // - on aquire :
12
+ // - on acquire :
13
13
// - if last call was > interval length ago, refill bucket
14
14
// - if there are tokens available, spend one and return immediately
15
15
// - if not, wait until the end of interval, refill and spend one
You can’t perform that action at this time.
0 commit comments