This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 8947919  bugfix: use correct version of etcd in 
linux_apisix_master_luarocks (#2343)
8947919 is described below

commit 89479194cc7518e8a14bb216cdcb09786cc3ef45
Author: Shuyang Wu <wosoyo...@gmail.com>
AuthorDate: Tue Sep 29 10:30:13 2020 +0800

    bugfix: use correct version of etcd in linux_apisix_master_luarocks (#2343)
---
 .travis/linux_apisix_master_luarocks_runner.sh | 4 +++-
 apisix/core/config_etcd.lua                    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/.travis/linux_apisix_master_luarocks_runner.sh 
b/.travis/linux_apisix_master_luarocks_runner.sh
index a7b684c..1a992ae 100755
--- a/.travis/linux_apisix_master_luarocks_runner.sh
+++ b/.travis/linux_apisix_master_luarocks_runner.sh
@@ -40,6 +40,8 @@ do_install() {
     sudo make install > build.log 2>&1 || (cat build.log && exit 1)
     cd ..
     rm -rf luarocks-2.4.4
+
+    ./utils/install-etcd.sh
 }
 
 script() {
@@ -48,7 +50,7 @@ script() {
     openresty -V
     sudo service etcd stop
     mkdir -p ~/etcd-data
-    /usr/bin/etcd --listen-client-urls 'http://0.0.0.0:2379' 
--advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > 
/dev/null 2>&1 &
+    etcd --listen-client-urls 'http://0.0.0.0:2379' 
--advertise-client-urls='http://0.0.0.0:2379' --data-dir ~/etcd-data > 
/dev/null 2>&1 &
     etcd --version
     sleep 5
 
diff --git a/apisix/core/config_etcd.lua b/apisix/core/config_etcd.lua
index eb10417..28590e3 100644
--- a/apisix/core/config_etcd.lua
+++ b/apisix/core/config_etcd.lua
@@ -126,7 +126,7 @@ local function waitdir(etcd_cli, key, modified_index, 
timeout)
 
     if http_cli then
         local res_cancel, err_cancel = etcd_cli:watchcancel(http_cli)
-        if res_cancel and res_cancel == 1 then
+        if res_cancel == 1 then
             log.info("cancel watch connection success")
         else
             log.error("cancel watch failed: ", err_cancel)
@@ -139,7 +139,7 @@ local function waitdir(etcd_cli, key, modified_index, 
timeout)
     end
 
     if type(res.result) ~= "table" then
-        return nil, "failed to read etcd dir"
+        return nil, "failed to wait etcd dir"
     end
     return etcd_apisix.watch_format(res)
 end

Reply via email to