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 2021/02/25 11:15:37 UTC

[GitHub] [apisix] spacewander opened a new pull request #3672: chore: use status code directly like other similar places

spacewander opened a new pull request #3672:
URL: https://github.com/apache/apisix/pull/3672


   See https://github.com/apache/apisix/pull/3629#discussion_r582423351
   
   Signed-off-by: spacewander <sp...@gmail.com>
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   * [x] 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](https://github.com/apache/apisix/tree/master#community) first**
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #3672: chore: return with number literal directly like other similar places

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #3672:
URL: https://github.com/apache/apisix/pull/3672#discussion_r582810276



##########
File path: apisix/upstream.lua
##########
@@ -191,7 +191,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")

Review comment:
       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.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] membphis merged pull request #3672: chore: capitalize the constant

Posted by GitBox <gi...@apache.org>.
membphis merged pull request #3672:
URL: https://github.com/apache/apisix/pull/3672


   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on a change in pull request #3672: chore: capitalize the constant

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #3672:
URL: https://github.com/apache/apisix/pull/3672#discussion_r583309777



##########
File path: apisix/upstream.lua
##########
@@ -191,7 +191,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")

Review comment:
       OK.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tokers commented on a change in pull request #3672: chore: return with number literal directly like other similar places

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #3672:
URL: https://github.com/apache/apisix/pull/3672#discussion_r582796509



##########
File path: apisix/upstream.lua
##########
@@ -191,7 +191,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")

Review comment:
       Why not use ngx.HTTP_SERVICE_UNAVAILABLE




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org