优化 排行榜使用redis缓存
This commit is contained in:
+2
-12
@@ -8,7 +8,7 @@ import {
|
||||
RouteRecord
|
||||
} from 'pinus';
|
||||
import * as mongoose from 'mongoose';
|
||||
import * as redis from 'redis';
|
||||
import * as redisService from './app/services/redisService';
|
||||
import './app/servers/user.rpc.define'
|
||||
import * as routeUtil from './app/util/routeUtil';
|
||||
import { preload } from './preload';
|
||||
@@ -55,17 +55,7 @@ mongoose.connect(mongoAddr, { useNewUrlParser: true, useUnifiedTopology: true },
|
||||
}
|
||||
});
|
||||
|
||||
// 创建 redis 连接
|
||||
const client = redis.createClient(6379, redisArr, {detect_buffers: true});
|
||||
client.auth('zyz_2020', (err, reply) => {
|
||||
if (err) {
|
||||
console.log('redis err', err);
|
||||
} else {
|
||||
console.log('redis suc');
|
||||
}
|
||||
})
|
||||
client.set('hello', 'redis', redis.print);
|
||||
|
||||
redisService.initRank();
|
||||
/**
|
||||
* Init app for client.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user