optimize: flowControl property is not necessary (#31)

optimize: flowControl property is not necessary
This commit is contained in:
dxfeng10
2021-01-19 10:04:28 +08:00
committed by GitHub
parent f11dd97e8f
commit 2d39d6849b
3 changed files with 9 additions and 3 deletions

View File

@@ -20,6 +20,7 @@ package we.config;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.ReactiveStringRedisTemplate;
@@ -73,7 +74,8 @@ public class FlowStatSchedConfig extends SchedConfig {
@Value("${flowControl:false}")
private boolean flowControl;
@Resource
// @Resource
@Autowired(required = false)
private FlowStat flowStat;
@Resource

View File

@@ -20,6 +20,7 @@ package we.controller;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -55,7 +56,8 @@ public class FlowControlController {
@Value("${flowControl:false}")
private boolean flowControl;
@Resource
// @Resource
@Autowired(required = false)
private FlowStat flowStat;
@GetMapping("/globalConcurrentsRps")

View File

@@ -24,6 +24,7 @@ import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpHeaders;
@@ -65,7 +66,8 @@ public class FlowControlFilter extends ProxyAggrFilter {
@Resource
private ResourceRateLimitConfigService resourceRateLimitConfigService;
@Resource
// @Resource
@Autowired(required = false)
private FlowStat flowStat;
@Override