9268 commented on code in PR #12867:
URL: https://github.com/apache/apisix/pull/12867#discussion_r3007221635
##########
apisix/discovery/nacos/init.lua:
##########
@@ -348,12 +354,27 @@ local function fetch_from_host(base_uri, username,
password, services)
end
for key, nodes in pairs(nodes_cache) do
- local content = core.json.encode(nodes)
- nacos_dict:set(key, content)
+ local content = core.json.stably_encode(nodes)
+ local ok, err = nacos_dict:safe_set(key, content)
+ if not ok then
+ log.error("failed to set nacos discovery content for key: ", key,
+ ", error: ", err)
+ -- No further action possible beyond logging the error
+ else
+ local nodes_version = ngx.crc32_long(content)
+ local ok_ver, err_ver = nacos_dict:safe_set(key .. "#version",
nodes_version)
Review Comment:
you'r right,i will fix it later
--
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]