You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/04/28 06:22:55 UTC
[GitHub] [apisix] spacewander commented on a diff in pull request #6934: fix(balancer): Use default priority when setting upstream doesn't specify priority
spacewander commented on code in PR #6934:
URL: https://github.com/apache/apisix/pull/6934#discussion_r860525004
##########
apisix/balancer.lua:
##########
@@ -50,12 +50,17 @@ local function transform_node(new_nodes, node)
new_nodes._priority_index = {}
end
- if not new_nodes[node.priority] then
- new_nodes[node.priority] = {}
- core.table.insert(new_nodes._priority_index, node.priority)
+ local node_priority = 0 -- if nodes don't specify priority using default
+ if node.priority then
Review Comment:
Is it possible to call https://github.com/apache/apisix/blob/353e10b60e3604f80bae173a07c3c570f38ae367/apisix/upstream.lua#L179?
We already have a fixing logic in https://github.com/apache/apisix/blob/353e10b60e3604f80bae173a07c3c570f38ae367/apisix/upstream.lua#L219.
It will be terrible to fill a default value in three places.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org