2261
return nil
2262
}
2263
>
burst := max(1, int(float64(rps)*s.config.BusinessIDReuseBurstRatio(namespaceID.String())))
context_impl.go
2264
>
key := namespaceID.String() + "/" + businessID + "/" + strconv.Itoa(int(archetypeID))
2265
>
existing := s.businessIDRateLimiters.Get(key)
2266
>
if existing == nil {
2267
>
rl := quotas.NewRateLimiter(float64(rps), burst)
2268
>
existing, _ = s.businessIDRateLimiters.PutIfNotExist(key, rl)
2269
>
}
2270
>
rl, ok := existing.(*quotas.RateLimiterImpl)
2271
>
if !ok {
2272
// Should never happen; cache only stores *RateLimiterImpl.
2273
return nil
2274
}
2275
>
if float64(rps) != rl.Rate() || burst != rl.Burst() {
context_impl.go
2276
rl.SetRateBurst(float64(rps), burst)
2277
}
2279
}
2280