You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by sp...@apache.org on 2021/04/26 05:13:57 UTC

[apisix] branch master updated: fix(healthcheck): only one_loop is needed in the passive health check report (#4116)

This is an automated email from the ASF dual-hosted git repository.

spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new dba0176  fix(healthcheck): only one_loop is needed in the passive health check report (#4116)
dba0176 is described below

commit dba01760ca4b767a6fd6bac1ae03b40feb4bcb95
Author: Ben0625 <75...@users.noreply.github.com>
AuthorDate: Mon Apr 26 13:13:48 2021 +0800

    fix(healthcheck): only one_loop is needed in the passive health check report (#4116)
    
    Co-authored-by: Ben0625 <Be...@github.com>
    Co-authored-by: spacewander <sp...@gmail.com>
---
 apisix/init.lua | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/apisix/init.lua b/apisix/init.lua
index 3caa69c..6d8234b 100644
--- a/apisix/init.lua
+++ b/apisix/init.lua
@@ -615,13 +615,11 @@ local function healthcheck_passive(api_ctx)
     end
 
     for i, status in ipairs(http_statuses) do
-        for i, status in ipairs(http_statuses) do
-            if resp_status == status then
-                checker:report_http_status(api_ctx.balancer_ip,
-                                           port or api_ctx.balancer_port,
-                                           host,
-                                           resp_status)
-            end
+        if resp_status == status then
+            checker:report_http_status(api_ctx.balancer_ip,
+                                       port or api_ctx.balancer_port,
+                                       host,
+                                       resp_status)
         end
     end
 end