Skip to content

Commit

Permalink
chore: capitalize the constant (#3672)
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander committed Feb 27, 2021
1 parent 3950e4a commit e2f1fc6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apisix/upstream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ local is_http = ngx.config.subsystem == "http"
local upstreams
local healthcheck

local http_code_upstream_unavailable = ngx.HTTP_SERVICE_UNAVAILABLE

local HTTP_CODE_UPSTREAM_UNAVAILABLE = 503
local _M = {}


Expand Down Expand Up @@ -216,7 +216,7 @@ function _M.set_by_route(route, api_ctx)

local new_nodes, err = dis.nodes(up_conf.service_name)
if not new_nodes then
return http_code_upstream_unavailable, "no valid upstream node: " .. (err or "nil")
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "no valid upstream node: " .. (err or "nil")
end

local same = upstream_util.compare_upstream_node(up_conf, new_nodes)
Expand All @@ -243,7 +243,7 @@ function _M.set_by_route(route, api_ctx)

local nodes_count = up_conf.nodes and #up_conf.nodes or 0
if nodes_count == 0 then
return http_code_upstream_unavailable, "no valid upstream node"
return HTTP_CODE_UPSTREAM_UNAVAILABLE, "no valid upstream node"
end

if not is_http then
Expand Down

0 comments on commit e2f1fc6

Please sign in to comment.