Skip to content

chore: capitalize the constant #3672

Merged
membphis merged 1 commit into
apache:masterfrom
spacewander:5033
Feb 27, 2021
Merged

chore: capitalize the constant #3672
membphis merged 1 commit into
apache:masterfrom
spacewander:5033

Conversation

@spacewander

Copy link
Copy Markdown
Member

See #3629 (comment)

Signed-off-by: spacewander [email protected]

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@spacewander
spacewander marked this pull request as ready for review February 25, 2021 11:15
@spacewander spacewander mentioned this pull request Feb 25, 2021
4 tasks
@spacewander spacewander changed the title chore: use status code directly like other similar places chore: return with number literal directly like other similar places Feb 25, 2021
Comment thread apisix/upstream.lua
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")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use ngx.HTTP_SERVICE_UNAVAILABLE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is because the status code for this has been changed from 500 to 503. So the original contributor use a variable instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@spacewander spacewander changed the title chore: return with number literal directly like other similar places chore: capitalize the constant Feb 25, 2021
@membphis
membphis merged commit e2f1fc6 into apache:master Feb 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants