Skip to content

Commit

Permalink
fix(*): remove callback lock
Browse files Browse the repository at this point in the history
  • Loading branch information
windmgc committed May 10, 2024
1 parent d42f992 commit 53503e8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/resty/healthcheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1255,6 +1255,7 @@ local function checker_callback(self, health_mode)
local targets, err = fetch_target_list(self)
if not targets then
self:log(ERR, "checker_callback: ", err)
remove_callback_lock(self.shm, callback_lock)
return
end

Expand All @@ -1278,6 +1279,7 @@ local function checker_callback(self, health_mode)

if not list_to_check[1] then
self:log(DEBUG, "checking ", health_mode, " targets: nothing to do")
remove_callback_lock(self.shm, callback_lock)
else
local timer = resty_timer({
interval = 0,
Expand All @@ -1292,6 +1294,7 @@ local function checker_callback(self, health_mode)
})
if timer == nil then
self:log(ERR, "failed to create timer to check ", health_mode)
remove_callback_lock(self.shm, callback_lock)
end
end
end
Expand Down

0 comments on commit 53503e8

Please sign in to comment.