membphis commented on code in PR #8102:
URL: https://github.com/apache/apisix/pull/8102#discussion_r996883413


##########
apisix/core/improve.lua:
##########
@@ -0,0 +1,110 @@
+--

Review Comment:
   we should use `ai.lua`



##########
apisix/init.lua:
##########
@@ -374,7 +375,9 @@ function _M.http_access_phase()
     api_ctx.var.real_request_uri = api_ctx.var.request_uri
     api_ctx.var.request_uri = api_ctx.var.uri .. api_ctx.var.is_args .. 
(api_ctx.var.args or "")
 
+    improve.router_match(api_ctx)
     router.router_http.match(api_ctx)
+    improve.router_match_post(api_ctx)

Review Comment:
   ditto



##########
apisix/http/router/radixtree_uri.lua:
##########
@@ -18,6 +18,7 @@ local require = require
 local core = require("apisix.core")
 local base_router = require("apisix.http.route")
 local get_services = require("apisix.http.service").services
+local routes_analyze = require("apisix.core.improve").routes_analyze

Review Comment:
   ```lua
   local ai = require("apisix.core.ai")
   ... ...
   ai.routes_analyze(user_routes.values)
   ```
   
   this way is much better, we can replace `routes_analyze` dynamic later.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to