Commit c68e3f07 authored by 许润龙's avatar 许润龙

修改:活动视频、直播数据详情数据接口

parent 7b9600e5
......@@ -55,13 +55,13 @@ public class BaseService {
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
// String header = "token";
// String fawKey = String.format("%s:%s:limit", dataType, header);
// RRateLimiter rateLimiter = redissonClient.getRateLimiter(fawKey);
// rateLimiter.trySetRate(RateType.OVERALL, limit, limitPeriod, RateIntervalUnit.SECONDS);
// if (!rateLimiter.tryAcquire(1, waiting, TimeUnit.MILLISECONDS)) {
// return BaseController.error("10010", "您的请求太过频繁,请稍后再试!");
// }
String header = "token";
String fawKey = String.format("%s:%s:limit", dataType, header);
RRateLimiter rateLimiter = redissonClient.getRateLimiter(fawKey);
rateLimiter.trySetRate(RateType.OVERALL, limit, limitPeriod, RateIntervalUnit.SECONDS);
if (!rateLimiter.tryAcquire(1, waiting, TimeUnit.MILLISECONDS)) {
return BaseController.error("10010", "您的请求太过频繁,请稍后再试!");
}
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment