Remove reloads when there is no endpoints

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-11-05 15:48:33 -03:00
parent b4c5af1b85
commit 3838145a8c
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
2 changed files with 12 additions and 11 deletions

View file

@ -68,6 +68,11 @@ local function format_ipv6_endpoints(endpoints)
end
local function sync_backend(backend)
if not backend.endpoints or #backend.endpoints == 0 then
ngx.log(ngx.INFO, string.format("there is no endpoint for backend %s. Skipping...", backend.name))
return
end
local implementation = get_implementation(backend)
local balancer = balancers[backend.name]