Skip to content

Commit

Permalink
bugfix: raise error when none of the configured etcd can be connected (
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander authored and SaberMaster committed Jun 30, 2020
1 parent b1a40ae commit d19a1e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/apisix
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ local function init_etcd(show_output)

local host_count = #(yaml_conf.etcd.host)

local etcd_ok = false
for index, host in ipairs(yaml_conf.etcd.host) do

local is_success = true
Expand Down Expand Up @@ -799,9 +800,14 @@ local function init_etcd(show_output)
end

if is_success then
etcd_ok = true
break
end
end

if not etcd_ok then
error("none of the configured etcd works well")
end
end
_M.init_etcd = init_etcd

Expand Down

0 comments on commit d19a1e5

Please sign in to comment.