dyrnq commented on code in PR #8928:
URL: https://github.com/apache/apisix/pull/8928#discussion_r1116420520


##########
apisix/discovery/consul/init.lua:
##########
@@ -215,14 +215,38 @@ function _M.connect(premature, consul_server, retry_delay)
 
     -- if current index different last index then update service
     if consul_server.index ~= watch_result.headers['X-Consul-Index'] then
-        local up_services = core.table.new(0, #watch_result.body)
+
+        local consul_client_catalog = resty_consul:new({
+            host = consul_server.host,
+            port = consul_server.port,
+            connect_timeout = consul_server.connect_timeout,
+            read_timeout = consul_server.read_timeout,
+        })
+
+        local catalog_result, catalog_err = 
consul_client_catalog:get(consul_server.consul_catalog_sub_url)
+        local catalog_error_info = (catalog_err ~= nil and catalog_err)
+                or ((catalog_result ~= nil and catalog_result.status ~= 200)
+                and catalog_result.status)
+        if catalog_error_info then
+            log.error("connect consul: ", consul_server.consul_server_url,
+                " by sub url: ", consul_server.consul_catalog_sub_url,
+                ", got watch result: ", json_delay_encode(catalog_result, 
true),
+                ", with error: ", catalog_error_info)
+            -- retry_delay = get_retry_delay(retry_delay)

Review Comment:
   removed done



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