Commit 95eb70cb by 徐高华

api限制300/s

parent b9cb0ba6
......@@ -466,7 +466,7 @@ public class HmLinkApiServiceImpl implements HmLinkApiService {
private String limitIp(HmQrcodeBO hm) {
String ipKey = "hmadd:limit:ip";
int ipLimitCount = 200;
int ipLimitCount = 300;
RRateLimiter rateLimiter = RedisUtil.getRedisClient().getRateLimiter(ipKey);
rateLimiter.trySetRate(RateType.OVERALL, ipLimitCount, 1, RateIntervalUnit.SECONDS);
if (rateLimiter.tryAcquire()) {
......
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