You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by GitBox <gi...@apache.org> on 2022/07/02 09:14:07 UTC

[GitHub] [incubator-shenyu-nginx] impactCn commented on a diff in pull request #10: 1. commit zookeeper connection

impactCn commented on code in PR #10:
URL: https://github.com/apache/incubator-shenyu-nginx/pull/10#discussion_r895050440


##########
lib/shenyu/register/zookeeper/zk_cluster.lua:
##########
@@ -0,0 +1,55 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an"AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations un
+local zkclient              = require("shenyu.register.zookeeper.zk_client")

Review Comment:
   rockspec file not written.



##########
lib/shenyu/register/zookeeper/zk_cluster.lua:
##########
@@ -0,0 +1,55 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one or more
+-- contributor license agreements.  See the NOTICE file distributed with
+-- this work for additional information regarding copyright ownership.
+-- The ASF licenses this file to You under the Apache License, Version 2.0
+-- (the "License"); you may not use this file except in compliance with
+-- the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an"AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations un
+local zkclient              = require("shenyu.register.zookeeper.zk_client")
+local util                  = require("shenyu.register.core.utils")
+local ngx_log               = ngx.log
+local ipairs                = ipairs
+local _M                    = {}
+local mt                    = {__index = _M}
+local timeout               = 60 * 1000
+local table_len             = util.tlen
+local connects              = {}
+
+function _M.newInst(self, zkconfig)
+    -- body
+    return setmetatable({servers = zkconfig.servers, timeout = timeout}, mt)
+end
+
+function _M.connect(self)
+    local servers = self.servers
+    if not servers then
+        return nil, "servers is null"
+    end
+    --    初始化
+    local conn, err = zkclient:new()
+    if not conn then
+        ngx_log(ngx.ERR, "初始化zkClient失败" .. err)

Review Comment:
   use English.



-- 
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: notifications-unsubscribe@shenyu.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org