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

This commit is contained in:
GoEdgeLab
2021-11-04 11:13:54 +08:00
parent 10af1b2c72
commit 4be9f00156

View File

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