Commit 1ff9c9e3 authored by 朱允伟's avatar 朱允伟

<fix> 网关限流添加打印日志

parent 23a76368
...@@ -11,8 +11,6 @@ import org.springframework.stereotype.Component; ...@@ -11,8 +11,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange; import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import java.util.logging.Logger;
/** /**
* @author zyw * @author zyw
* @create 2021-10-08-18:37 * @create 2021-10-08-18:37
......
...@@ -46,11 +46,12 @@ public class RefreshApiLimitSchedule { ...@@ -46,11 +46,12 @@ public class RefreshApiLimitSchedule {
try { try {
JSONObject jo = new JSONObject(queryResult); JSONObject jo = new JSONObject(queryResult);
JSONArray data = jo.getJSONArray("data"); JSONArray data = jo.getJSONArray("data");
ApiLimitCache.BUCKET_CACHE.clear();
for (int i = 0; i < data.length(); i++) { for (int i = 0; i < data.length(); i++) {
JSONObject o = (JSONObject) data.get(i); JSONObject o = (JSONObject) data.get(i);
String name = o.get("name").toString(); String name = o.get("name").toString();
Integer singleLimit = Integer.parseInt(o.get("single_limit").toString()); Integer singleLimit = Integer.parseInt(o.get("single_limit").toString());
log.info("接口{}限流次数{}",name, singleLimit);
//桶的最大容量,即能装载 Token 的最大数量 //桶的最大容量,即能装载 Token 的最大数量
int capacity = singleLimit; int capacity = singleLimit;
//每次 Token 补充量 //每次 Token 补充量
......
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