From 19b23d8e47e9cdf92ec847387fc70cf2fa15e68a Mon Sep 17 00:00:00 2001 From: Jun Ouyang Date: Mon, 14 Nov 2022 15:53:00 +0800 Subject: [PATCH] feat(healthcheck) avoid duplication post in rebuild healthcheck scenario --- lib/resty/healthcheck.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/resty/healthcheck.lua b/lib/resty/healthcheck.lua index 3922d582..91ab891d 100644 --- a/lib/resty/healthcheck.lua +++ b/lib/resty/healthcheck.lua @@ -468,7 +468,9 @@ function checker:add_target(ip, port, hostname, is_healthy, hostheader) end -- raise event for our newly added target - self:raise_event(self.events[internal_health], ip, port, hostname) + if not found then + self:raise_event(self.events[internal_health], ip, port, hostname) + end return true end)