From 728d388b0888a6bb8ea920b4229f0de3d0f0734f 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 a043b6b9..f8e56270 100644 --- a/lib/resty/healthcheck.lua +++ b/lib/resty/healthcheck.lua @@ -499,7 +499,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)