Fix the error while setting current upstream peer

This commit is contained in:
ghostloda 2023-05-21 21:43:15 +08:00
parent 8d9210fd38
commit b6bdc8e50a

View file

@ -86,6 +86,8 @@ local function sync_backend(backend)
local implementation = get_implementation(backend) local implementation = get_implementation(backend)
local balancer = balancers[backend.name] local balancer = balancers[backend.name]
backend.endpoints = format_ipv6_endpoints(backend.endpoints)
if not balancer then if not balancer then
balancers[backend.name] = implementation:new(backend) balancers[backend.name] = implementation:new(backend)
return return
@ -105,8 +107,6 @@ local function sync_backend(backend)
backend = resolve_external_names(backend) backend = resolve_external_names(backend)
end end
backend.endpoints = format_ipv6_endpoints(backend.endpoints)
balancer:sync(backend) balancer:sync(backend)
end end