You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/11/20 02:42:01 UTC

[GitHub] [apisix] tokers commented on a change in pull request #2793: modify balancer.lua to solve issue that discovery Eureka cannot autom…

tokers commented on a change in pull request #2793:
URL: https://github.com/apache/apisix/pull/2793#discussion_r527356656



##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
     if checker then
         version = version .. "#" .. checker.status_ver
     end
+    local cache_key = key..ngx.md5(up_conf.nodes)

Review comment:
       The argument type of `ngx.md5` is string while `up_conf.nodes` is an array-like table.
   
   BTW, i don't think calculating the md5sum of nodes is a good way to differentiate the version, it's heavy, what about introducing the version mechanism for `up_conf.nodes`, either version number or last modify time is OK.

##########
File path: apisix/balancer.lua
##########
@@ -218,8 +219,9 @@ local function pick_server(route, ctx)
     if checker then
         version = version .. "#" .. checker.status_ver
     end
+    local cache_key = key..ngx.md5(up_conf.nodes)

Review comment:
       style: need space on both left and right side of `..`.




----------------------------------------------------------------
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:
users@infra.apache.org