Fix tests

This commit is contained in:
Manuel Alejandro de Brito Fontes 2018-11-16 17:52:46 -03:00
parent 654eceda46
commit af2dce901d
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
5 changed files with 55 additions and 26 deletions

View file

@ -148,14 +148,7 @@ function _M.balance()
return
end
local ctx = ngx.ctx
if not ctx.has_run then
ctx.has_run = true
local _, err = ngx_balancer.set_more_tries(1)
if err then
ngx.log(ngx.ERR, "failed to set more tries: ", err)
end
end
ngx_balancer.set_more_tries(1)
local ok, err = ngx_balancer.set_current_peer(peer)
if not ok then