fix(watchdog): Close dangling file descriptors on shutdown and config reload (#544)
* fix(watchdog): Add functions to avoid dangling file descriptors * Change function name and add comment under core/endpoint.go - change the function name of CloseHTTPConnection() to Close() - add some comments above Close() function * Update core/endpoint.go * Update core/endpoint.go --------- Co-authored-by: Richard Cheng <richard_cheng@trendmicro.com> Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
@ -96,6 +96,10 @@ func UpdateEndpointStatuses(endpoint *core.Endpoint, result *core.Result) {
|
||||
}
|
||||
|
||||
// Shutdown stops monitoring all endpoints
|
||||
func Shutdown() {
|
||||
func Shutdown(cfg *config.Config) {
|
||||
// Disable all the old HTTP connections
|
||||
for _, endpoint := range cfg.Endpoints {
|
||||
endpoint.Close()
|
||||
}
|
||||
cancelFunc()
|
||||
}
|
||||
|
Reference in New Issue
Block a user