Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(healthcheck) remove event watcher when stopping hc #74

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/resty/healthcheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,7 @@ end
function checker:stop()
self.checks.active.healthy.active = false
self.checks.active.unhealthy.active = false
worker_events.unregister(self.ev_callback, self.EVENT_SOURCE)
self:log(DEBUG, "healthchecker stopped")
return true
end
Expand Down Expand Up @@ -1437,7 +1438,6 @@ function _M.new(opts)
-- just a wrapper to be able to access `self` as a closure
return self:event_handler(event, data.ip, data.port, data.hostname)
end
worker_events.register_weak(self.ev_callback, self.EVENT_SOURCE)

-- handle events to sync up in case there was a change by another worker
worker_events:poll()
Expand Down