Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change: rename plugin's balancer method to before_proxy #4697

Merged
merged 1 commit into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apisix/balancer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions apisix/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion apisix/plugins/serverless/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down