-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
fengfei
committed
Mar 31, 2018
1 parent
bf291ec
commit 066ca17
Showing
8 changed files
with
86 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
local _M = {} | ||
|
||
function _M.balancing() | ||
local balancer = require "ngx.balancer" | ||
local host = ngx.var.backend_host | ||
local port = ngx.var.backend_port | ||
local ok, err = balancer.set_current_peer(host, port) | ||
if not ok then | ||
ngx.log(ngx.ERR, "failed to set the current peer: ", err) | ||
return ngx.exit(500) | ||
end | ||
ok, err = balancer.set_more_tries(3) | ||
if not ok then | ||
ngx.log(ngx.ERR, "failed to set more tries: ", err) | ||
return ngx.exit(500) | ||
end | ||
local balancer = require "ngx.balancer" | ||
local host = ngx.var.backend_host | ||
local port = ngx.var.backend_port | ||
local ok, err = balancer.set_current_peer(host, port) | ||
if not ok then | ||
ngx.log(ngx.ERR, "failed to set the current peer: ", err) | ||
return ngx.exit(500) | ||
end | ||
ok, err = balancer.set_more_tries(3) | ||
if not ok then | ||
ngx.log(ngx.ERR, "failed to set more tries: ", err) | ||
return ngx.exit(500) | ||
end | ||
end | ||
|
||
return _M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.