Skip to content

Commit

Permalink
reload configuration on controller msg handler
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-at-startupmedia committed Aug 5, 2024
1 parent 458d1e8 commit ab7b94c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 4 additions & 0 deletions pmond/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
4 changes: 0 additions & 4 deletions pmond/controller/drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package controller
import (
"errors"
"fmt"
"pmon3/pmond"
"pmon3/pmond/db"
"pmon3/pmond/model"
"pmon3/pmond/protos"
Expand All @@ -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(),
Expand Down

0 comments on commit ab7b94c

Please sign in to comment.