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

This commit is contained in:
刘祥超
2021-11-04 11:13:54 +08:00
parent dcdc0cb8c1
commit 0b73041718

View File

@@ -326,6 +326,16 @@ func (this *AdminNode) listenSock() error {
case "demo": case "demo":
teaconst.IsDemoMode = !teaconst.IsDemoMode teaconst.IsDemoMode = !teaconst.IsDemoMode
_ = cmd.ReplyOk() _ = 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,
},
})
} }
}) })