feat: support limit-conn in workflow plugin#12465
Merged
nic-6443 merged 14 commits intoAug 6, 2025
Merged
Conversation
nic-6443
reviewed
Jul 29, 2025
membphis
reviewed
Jul 31, 2025
| for _, rule in ipairs(conf.rules) do | ||
| local match_result = true | ||
| if rule.case then | ||
| local expr, _ = expr.new(rule.case) |
Member
There was a problem hiding this comment.
performance: we'd better to cache the expr and reuse it
Member
There was a problem hiding this comment.
Member
There was a problem hiding this comment.
we can store expr in conf.rules
Contributor
Author
There was a problem hiding this comment.
instead of caching expr in access phase. How about doing it in check_schema?
membphis
reviewed
Jul 31, 2025
| if not ok then | ||
| return false, "failed to validate the 'case' expression: " .. err | ||
| end | ||
| setmetatable(rule, { |
nic-6443
previously approved these changes
Jul 31, 2025
nic-6443
previously approved these changes
Jul 31, 2025
membphis
reviewed
Jul 31, 2025
| if key == "__expr" then | ||
| return expr | ||
| end | ||
| local mt = getmetatable(rule) or {} |
Member
There was a problem hiding this comment.
pls take a look at this style:
local my_table = {}
local meta = getmetatable(my_table)
if not meta then
meta = {}
setmetatable(my_table, meta)
end
meta.a = "a"
membphis
reviewed
Jul 31, 2025
| mt = {} | ||
| setmetatable(rule, mt) | ||
| end | ||
| mt.__index = function (_, key) |
Member
There was a problem hiding this comment.
this way is much better to read:
local my_table = {b="b"}
local meta = getmetatable(my_table)
if not meta then
meta = {}
meta.__index = meta
setmetatable(my_table, meta)
end
meta.a = "a"
print(my_table.a)
membphis
previously approved these changes
Jul 31, 2025
nic-6443
previously approved these changes
Jul 31, 2025
bzp2010
reviewed
Aug 5, 2025
nic-chen
reviewed
Aug 5, 2025
bzp2010
approved these changes
Aug 5, 2025
nic-6443
approved these changes
Aug 5, 2025
jizhuozhi
pushed a commit
to jizhuozhi/apisix
that referenced
this pull request
Oct 18, 2025
shreemaan-abhishek
pushed a commit
to shreemaan-abhishek/apisix
that referenced
this pull request
Jan 2, 2026
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for using limit-conn plugin inside the workflow plugin extending the functionality of workflow plugin.
Checklist