From 883a0b6671da550668602de848e7c424d586fc15 Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Thu, 24 Dec 2020 18:16:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20redis=20=E6=95=B0=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E9=87=8D=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/game-server/app.ts b/game-server/app.ts index e52fd170e..75db65944 100644 --- a/game-server/app.ts +++ b/game-server/app.ts @@ -59,14 +59,16 @@ mongoose.connect(mongoAddr, { useNewUrlParser: true, useUnifiedTopology: true, u } }); -redisService.initAllRank(); -redisService.clearComBtlQueue(); /** * Init app for client. */ let app = pinus.createApp(); app.set('name', 'chatofpomelo-websocket'); - +// TODO 重启 1 次只需要初始化 1 次,判断方法可以优化 +if (app.serverId === 'master-server-1') { + redisService.initAllRank(); + redisService.clearComBtlQueue(); +} // app configuration app.configure('production|development|local', 'connector', function () { app.set('connectorConfig',