shreemaan-abhishek commented on code in PR #13572:
URL: https://github.com/apache/apisix/pull/13572#discussion_r3445413883


##########
apisix/control/v1.lua:
##########
@@ -69,6 +71,54 @@ function _M.schema()
 end
 
 local healthcheck
+
+
+-- targets the checker registers for this upstream, keyed host:port
+-- (active-check port overrides the node port)
+local function get_configured_targets(up_conf)
+    local nodes = up_conf and up_conf.nodes
+    if type(nodes) ~= "table" then
+        return nil
+    end
+
+    local active = up_conf.checks and up_conf.checks.active
+    local override_port = active and active.port
+    local targets = core.table.new(0, #nodes)

Review Comment:
   ```suggestion
   local n = core.table.isarray(nodes) and #nodes or core.table.nkeys(nodes)
   local targets = core.table.new(0, n)
   ```



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