spacewander commented on a change in pull request #3758:
URL: https://github.com/apache/apisix/pull/3758#discussion_r592092002
##########
File path: apisix/plugins/traffic-split.lua
##########
@@ -309,7 +314,8 @@ function _M.access(conf, ctx)
return
end
- local rr_up, err = lrucache(weighted_upstreams, nil, new_rr_obj,
weighted_upstreams)
+ local rr_up, err = lrucache(weighted_upstreams, nil, new_rr_obj,
weighted_upstreams,
Review comment:
Try?
```diff
diff --git apisix/plugins/traffic-split.lua apisix/plugins/traffic-split.lua
index eb7a2028..966275f9 100644
--- apisix/plugins/traffic-split.lua
+++ apisix/plugins/traffic-split.lua
@@ -315,8 +315,8 @@ function _M.access(conf, ctx)
end
local route_upstream_id = ctx.matched_route.value.upstream_id
- local rr_up, err = lrucache(weighted_upstreams, nil, new_rr_obj,
weighted_upstreams,
- route_upstream_id)
+ local rr_up, err = core.lrucache.plugin_ctx(lrucache, ctx, nil,
new_rr_obj, weighted_upstreams,
+ route_upstream_id)
if not rr_up then
core.log.error("lrucache roundrobin failed: ", err)
return 500
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]