kingluo commented on code in PR #9456:
URL: https://github.com/apache/apisix/pull/9456#discussion_r1201549536
##########
apisix/core/config_etcd.lua:
##########
@@ -75,6 +85,208 @@ local mt = {
}
+local get_etcd
+do
+ local etcd_cli
+
+ function get_etcd()
+ if etcd_cli ~= nil then
+ return etcd_cli
+ end
+
+ local _, err
+ etcd_cli, _, err = etcd_apisix.get_etcd_syncer()
+ return etcd_cli, err
+ end
+end
+
+
+local function cancel_watch(http_cli)
+ local res, err = watch_ctx.cli:watchcancel(http_cli)
+ if res == 1 then
+ log.info("cancel watch connection success")
+ else
+ log.error("cancel watch failed: ", err)
+ end
+end
+
+
+-- append res to the queue and notify pending watchers
+local function produce_res(res, err)
+ if log_level >= NGX_INFO then
+ log.info("append res: ", inspect(res), ", err: ", inspect(err))
+ end
Review Comment:
the delay stuff has bug:
https://github.com/apache/apisix/blob/a943c036987aa2e9a34f05060015ff65b8913345/apisix/core/json.lua#L116-L120
It only uses a singleton table to log, but here I need two vars to log.
And inspect is more informational than json for debugging.
--
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]