ChuanFF commented on code in PR #12991:
URL: https://github.com/apache/apisix/pull/12991#discussion_r2866890775


##########
apisix/admin/upstreams.lua:
##########
@@ -26,6 +26,52 @@ local apisix_upstream = require("apisix.upstream")
 local resource = require("apisix.admin.resource")
 local tostring = tostring
 local ipairs = ipairs
+local ngx_time = ngx.time
+
+
+local function update_warm_up_timestamps(conf, old_conf)
+    if not conf or not conf.nodes or not core.table.isarray(conf.nodes) then
+        return
+    end
+
+    local previous_node_update_time = {}
+    if old_conf and old_conf.nodes and core.table.isarray(old_conf.nodes) then
+        for _, node in ipairs(old_conf.nodes) do
+            local key = (node.domain or node.host) .. ":" .. 
tostring(node.port)
+            previous_node_update_time[key] = node.update_time
+        end
+    end
+
+    for _, node in ipairs(conf.nodes) do
+        if not node.update_time then
+            local key = (node.domain or node.host) .. ":" .. 
tostring(node.port)
+            node.update_time = previous_node_update_time[key] or ngx_time()

Review Comment:
   filter_upstream will be called by route/service, the problem is not exists.



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