支持info指令查询PID、版本号等信息

This commit is contained in:
刘祥超
2021-11-04 11:15:22 +08:00
parent 37c8a8c955
commit ea40dc7534

View File

@@ -499,6 +499,16 @@ func (this *APINode) listenSock() error {
"pid": os.Getpid(),
},
})
case "info":
exePath, _ := os.Executable()
_ = cmd.Reply(&gosock.Command{
Code: "info",
Params: map[string]interface{}{
"pid": os.Getpid(),
"version": teaconst.Version,
"path": exePath,
},
})
case "stop":
_ = cmd.ReplyOk()