chore: update unauthorized callback calling order (#1469)

* chore: update unauthorized callback calling order

* chore: add comments
This commit is contained in:
Kevin Wan
2022-01-20 21:09:45 +08:00
committed by GitHub
parent df0f8ed59e
commit fdc7f64d6f
3 changed files with 9 additions and 4 deletions

View File

@@ -112,7 +112,8 @@ func (lim *TokenLimiter) reserveN(now time.Time, n int) bool {
// Lua boolean false -> r Nil bulk reply
if err == redis.Nil {
return false
} else if err != nil {
}
if err != nil {
logx.Errorf("fail to use rate limiter: %s, use in-process limiter for rescue", err)
lim.startMonitor()
return lim.rescueLimiter.AllowN(now, n)