-
Notifications
You must be signed in to change notification settings - Fork 170
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
[rate-limit] Multi limits using the same type of limiter. #825
Conversation
t/apicast-policy-rate-limit.t
Outdated
@@ -1169,3 +1169,64 @@ so only the third call returns 429. | |||
[200, 200, 200, 429] | |||
--- no_error_log | |||
[error] | |||
|
|||
=== TEST 19: Rejected (count). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you mention in the title or the description that this is testing a config with multiple limiters of the same type?
Without that, it's difficult to know what this test is testing that all the rest are not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
t/apicast-policy-rate-limit.t
Outdated
local redis_key2 = redis:keys('*_fixed_window_/test19_1')[1] | ||
local redis_key3 = redis:keys('*_fixed_window_/test19_2')[1] | ||
local redis_key4 = redis:keys('*_fixed_window_/test19_3')[1] | ||
redis:del(redis_key1, redis_key2, redis_key3, redis_key4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you considered using the flushdb
command?
https://redis.io/commands/flushdb
It might help us simplify some code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
Thanks for your contribution @y-tabata ! 👍 The PR looks good. I added a couple of minor comments. Can you add an entry in the changelog under the |
@davidor thank you for reviewing! 👍 |
When I define multipul limits using the same type of limiter,
The following error message is displayed.
I fixed this by removing
table.unpack
.