mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-10 05:32:25 +08:00
优化服务器之间的底层连接方式
This commit is contained in:
@@ -40,10 +40,13 @@ func Run(ctx context.Context, configFile string) error {
|
||||
ticker := time.NewTicker(time.Second * 15)
|
||||
for {
|
||||
<-ticker.C
|
||||
_, _ = client.Discovery.KeepaliveServer(context.TODO(), &api.KeepaliveServerReq{
|
||||
_, err := client.Discovery.KeepaliveServer(context.TODO(), &api.KeepaliveServerReq{
|
||||
ServerType: api.FIGHT,
|
||||
AppId: APPID,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("keepalive error: %v", err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
defer func() {
|
||||
@@ -58,7 +61,7 @@ func Run(ctx context.Context, configFile string) error {
|
||||
|
||||
constant.InitConstant()
|
||||
|
||||
messageQueue := mq.NewMessageQueue(api.FIGHT, APPID)
|
||||
messageQueue := mq.NewMessageQueue(api.FIGHT, APPID, client)
|
||||
defer messageQueue.Close()
|
||||
|
||||
_ = engine.NewFightEngine(messageQueue)
|
||||
|
||||
Reference in New Issue
Block a user