fix: redis 数据不需要重复初始化
This commit is contained in:
+5
-3
@@ -59,14 +59,16 @@ mongoose.connect(mongoAddr, { useNewUrlParser: true, useUnifiedTopology: true, u
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
redisService.initAllRank();
|
|
||||||
redisService.clearComBtlQueue();
|
|
||||||
/**
|
/**
|
||||||
* Init app for client.
|
* Init app for client.
|
||||||
*/
|
*/
|
||||||
let app = pinus.createApp();
|
let app = pinus.createApp();
|
||||||
app.set('name', 'chatofpomelo-websocket');
|
app.set('name', 'chatofpomelo-websocket');
|
||||||
|
// TODO 重启 1 次只需要初始化 1 次,判断方法可以优化
|
||||||
|
if (app.serverId === 'master-server-1') {
|
||||||
|
redisService.initAllRank();
|
||||||
|
redisService.clearComBtlQueue();
|
||||||
|
}
|
||||||
// app configuration
|
// app configuration
|
||||||
app.configure('production|development|local', 'connector', function () {
|
app.configure('production|development|local', 'connector', function () {
|
||||||
app.set('connectorConfig',
|
app.set('connectorConfig',
|
||||||
|
|||||||
Reference in New Issue
Block a user