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

This commit is contained in:
刘祥超
2021-11-04 11:14:02 +08:00
parent 4f7b9f4fc6
commit 083bbb1460

View File

@@ -496,6 +496,16 @@ func (this *Node) 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()