add limit rate filter debug log (#417)

Co-authored-by: rod.xu <rod.xu@yunlsp.com>
Co-authored-by: Haotian Zhang <928016560@qq.com>
pull/428/head
许路路 2 years ago committed by GitHub
parent d99e99583c
commit c347054f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
# Change Log # Change Log
--- ---
- [Bugfix: optimize ratelimit actuator](https://github.com/Tencent/spring-cloud-tencent/pull/413) - [Bugfix: optimize ratelimit actuator](https://github.com/Tencent/spring-cloud-tencent/pull/413)
- [Feature: add rate limit filter debug log](https://github.com/Tencent/spring-cloud-tencent/pull/417)

@ -39,4 +39,4 @@
- [docs:optimize example](https://github.com/Tencent/spring-cloud-tencent/pull/385) - [docs:optimize example](https://github.com/Tencent/spring-cloud-tencent/pull/385)
- [Optimize starters auto-configuration. (main)](https://github.com/Tencent/spring-cloud-tencent/pull/391/files) - [Optimize starters auto-configuration. (main)](https://github.com/Tencent/spring-cloud-tencent/pull/391/files)
- [Feature: format code](https://github.com/Tencent/spring-cloud-tencent/pull/394) - [Feature: format code](https://github.com/Tencent/spring-cloud-tencent/pull/394)
- [test: add PostInitPolarisSDKContextTest](https://github.com/Tencent/spring-cloud-tencent/pull/397) - [test: add PostInitPolarisSDKContextTest](https://github.com/Tencent/spring-cloud-tencent/pull/397)

@ -114,6 +114,7 @@ public class QuotaCheckReactiveFilter implements WebFilter, Ordered {
} }
// Unirate // Unirate
if (quotaResponse.getCode() == QuotaResultCode.QuotaResultOk && quotaResponse.getWaitMs() > 0) { if (quotaResponse.getCode() == QuotaResultCode.QuotaResultOk && quotaResponse.getWaitMs() > 0) {
LOG.debug("The request of [{}] will waiting for {}ms.", path, quotaResponse.getWaitMs());
return Mono.delay(Duration.ofMillis(quotaResponse.getWaitMs())).flatMap(e -> chain.filter(exchange)); return Mono.delay(Duration.ofMillis(quotaResponse.getWaitMs())).flatMap(e -> chain.filter(exchange));
} }
} }

@ -110,6 +110,7 @@ public class QuotaCheckServletFilter extends OncePerRequestFilter {
} }
// Unirate // Unirate
if (quotaResponse.getCode() == QuotaResultCode.QuotaResultOk && quotaResponse.getWaitMs() > 0) { if (quotaResponse.getCode() == QuotaResultCode.QuotaResultOk && quotaResponse.getWaitMs() > 0) {
LOG.debug("The request of [{}] will waiting for {}ms.", request.getRequestURI(), quotaResponse.getWaitMs());
Thread.sleep(quotaResponse.getWaitMs()); Thread.sleep(quotaResponse.getWaitMs());
} }

Loading…
Cancel
Save