!246 fix: 限流次数不对 Merge pull request !246 from @xiaochangbai/pr/optime_lock

Merge pull request !246 from @xiaochangbai/pr/optime_lock
This commit is contained in:
Chopper711 2022-10-26 09:26:19 +00:00 committed by Gitee
commit 191cee25a4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -61,7 +61,7 @@ public class LimitInterceptor {
assert count != null;
log.info("限制请求{}, 当前请求{},缓存key{}", limitCount, count.intValue(), key);
//如果缓存里没有值或者他的值小于限制频率
if (count.intValue() >= limitCount) {
if (count.intValue() > limitCount) {
throw new ServiceException(ResultCode.LIMIT_ERROR);
}
}