From ab7b94c8075267088f52d6c548ef2c7a54ab5d79 Mon Sep 17 00:00:00 2001 From: joe-at-startupmedia Date: Mon, 5 Aug 2024 06:33:06 +0000 Subject: [PATCH] reload configuration on controller msg handler --- pmond/controller/controller.go | 4 ++++ pmond/controller/drop.go | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pmond/controller/controller.go b/pmond/controller/controller.go index d9aaa54..2a0425c 100644 --- a/pmond/controller/controller.go +++ b/pmond/controller/controller.go @@ -18,6 +18,10 @@ func ErroredCmdResp(cmd *protos.Cmd, err error) *protos.CmdResp { func MsgHandler(cmd *protos.Cmd) (processed []byte, err error) { pmond.Log.Infof("got a cmd: %s", cmd) + + //reload the configuration file for possible changes + pmond.ReloadConf() + var cmdResp *protos.CmdResp switch cmd.GetName() { case "log": diff --git a/pmond/controller/drop.go b/pmond/controller/drop.go index 3289256..d9bd40c 100644 --- a/pmond/controller/drop.go +++ b/pmond/controller/drop.go @@ -3,7 +3,6 @@ package controller import ( "errors" "fmt" - "pmon3/pmond" "pmon3/pmond/db" "pmon3/pmond/model" "pmon3/pmond/protos" @@ -28,9 +27,6 @@ func DropByParams(cmd *protos.Cmd, forced bool, status model.ProcessStatus) *pro _ = DeleteByParams(cmd, process.GetIdStr(), forced) } - //reload the configuration file for possible changes - pmond.ReloadConf() - newCmdResp := protos.CmdResp{ Id: cmd.GetId(), Name: cmd.GetName(),