zaunist commented on a change in pull request #6509:
URL: https://github.com/apache/apisix/pull/6509#discussion_r820323414



##########
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 checked the other methods in etcd.lua, push, delete, set, etc. all 
return nil, and I think I'm correct in returning nil here. Shouldn't the code 
style of a repository be uniform? Even if the default value is nil, it should 
be explicitly shown in the code, so that the logic of the code is clearer.




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