zaunist commented on a change in pull request #6509:
URL: https://github.com/apache/apisix/pull/6509#discussion_r821249236
##########
File path: apisix/core/etcd.lua
##########
@@ -360,4 +361,19 @@ function _M.server_version()
end
+function _M.keepalive(id)
+ local etcd_cli, _, err = new()
+ if not etcd_cli then
+ return nil, err
+ end
+
+ local res, err = etcd_cli:keepalive(id)
+ if not res then
+ return nil, err
+ end
+
+ return res, nil
Review comment:
I checke APISIX repo, other file has the same situation. Example:
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/balancer/ewma.lua#L93
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/balancer/ewma.lua#L100
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/core/schema.lua#L56
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/core/utils.lua#L137
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/plugins/basic-auth.lua#L112
-
https://github.com/apache/apisix/blob/cb2ba6819f72d75053f8f95aa781975dca2223fd/apisix/plugins/openid-connect.lua#L159
There are more places where there is a similar situation, where nil is
returned when err equals nil, do we need to be uniform for those as well?
--
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]