mirror of
https://gitee.com/iresty/apisix.git
synced 2024-12-05 05:27:35 +08:00
change: rename plugin's balancer method to before_proxy (#4697)
This is confusing to have plugin's balancer method and user-defined balancer. Signed-off-by: spacewander <spacewanderlzx@gmail.com>
This commit is contained in:
parent
6655a35889
commit
e1d9f35f60
@ -321,7 +321,7 @@ function _M.run(route, ctx, plugin_funcs)
|
||||
end
|
||||
end
|
||||
|
||||
local _, run = plugin_funcs("balancer")
|
||||
local _, run = plugin_funcs("before_proxy")
|
||||
-- always recreate request as the request may be changed by plugins
|
||||
if (run or header_changed) and balancer.recreate_request then
|
||||
balancer.recreate_request()
|
||||
|
@ -518,8 +518,8 @@ function _M.http_access_phase()
|
||||
|
||||
set_upstream_headers(api_ctx, server)
|
||||
|
||||
-- run the balancer phase in access phase first to avoid always reinit request
|
||||
common_phase("balancer")
|
||||
-- run the before_proxy method in access phase first to avoid always reinit request
|
||||
common_phase("before_proxy")
|
||||
|
||||
local ref = ctxdump.stash_ngx_ctx()
|
||||
core.log.info("stash ngx ctx: ", ref)
|
||||
@ -913,8 +913,8 @@ function _M.stream_preread_phase()
|
||||
|
||||
api_ctx.picked_server = server
|
||||
|
||||
-- run the balancer phase in preread phase first to avoid always reinit request
|
||||
common_phase("balancer")
|
||||
-- run the before_proxy method in preread phase first to avoid always reinit request
|
||||
common_phase("before_proxy")
|
||||
end
|
||||
|
||||
|
||||
|
@ -113,7 +113,7 @@ return function(plugin_name, priority)
|
||||
call_funcs('access', conf, ctx)
|
||||
end
|
||||
|
||||
function _M.balancer(conf, ctx)
|
||||
function _M.before_proxy(conf, ctx)
|
||||
call_funcs('balancer', conf, ctx)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user