Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve the logic for constructing redis key #1933

Merged
merged 1 commit into from
Mar 21, 2025

Conversation

rinfx
Copy link
Collaborator

@rinfx rinfx commented Mar 20, 2025

目前token限流插件存在bug,同一条限流规则,在修改阈值前后,会命中同一个redis key,造成的结果是:之前已经触发限流的规则,在调整阈值后仍然会被限流,直到上次限流的窗口过去。

修改redis key的构建规则,添加timeWindow和windowSize,这样可以保证修改规则可以重新计算限流。

@rinfx rinfx requested review from johnlanni and CH3CHO as code owners March 20, 2025 09:21
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 43.74%. Comparing base (ef31e09) to head (d9059e2).
Report is 361 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1933      +/-   ##
==========================================
+ Coverage   35.91%   43.74%   +7.83%     
==========================================
  Files          69       78       +9     
  Lines       11576    12479     +903     
==========================================
+ Hits         4157     5459    +1302     
+ Misses       7104     6678     -426     
- Partials      315      342      +27     

see 73 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@johnlanni johnlanni merged commit 2640c76 into alibaba:main Mar 21, 2025
12 checks passed
@rinfx rinfx mentioned this pull request Mar 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants