增加 edge-node reload 命令/优化命令行帮助

This commit is contained in:
GoEdgeLab
2022-02-25 11:23:32 +08:00
parent 36d8c3f366
commit 260dcbeeff
3 changed files with 34 additions and 5 deletions

View File

@@ -742,6 +742,17 @@ func (this *Node) listenSock() error {
runtime.GC()
debug.FreeOSMemory()
_ = cmd.ReplyOk()
case "reload":
err := this.syncConfig(0)
if err != nil {
_ = cmd.Reply(&gosock.Command{
Params: map[string]interface{}{
"error": err.Error(),
},
})
} else {
_ = cmd.ReplyOk()
}
}
})