增加redis配置
This commit is contained in:
parent
c6932fb7eb
commit
7bbf018538
@ -18,3 +18,4 @@ ADMIN_TOKEN_EXPIRESIN=1d
|
|||||||
DB_MAIN=mongodb://localhost/pyxis-development
|
DB_MAIN=mongodb://localhost/pyxis-development
|
||||||
DB_SECOND=mongodb://tiku:kingsome@192.168.100.30/tiku?authSource=tiku&w=1
|
DB_SECOND=mongodb://tiku:kingsome@192.168.100.30/tiku?authSource=tiku&w=1
|
||||||
|
|
||||||
|
REDIS=redis://127.0.0.1:6379/14
|
||||||
|
@ -17,3 +17,5 @@ ADMIN_TOKEN_EXPIRESIN=1d
|
|||||||
|
|
||||||
DB_MAIN=mongodb://188.88.0.2/pyxis-production
|
DB_MAIN=mongodb://188.88.0.2/pyxis-production
|
||||||
DB_SECOND=mongodb://188.88.0.2/pyxis2-production
|
DB_SECOND=mongodb://188.88.0.2/pyxis2-production
|
||||||
|
|
||||||
|
REDIS=redis://127.0.0.1:6379/14
|
||||||
|
@ -13,6 +13,7 @@ import config from 'config/config';
|
|||||||
import { initCfgData } from './common/GConfig'
|
import { initCfgData } from './common/GConfig'
|
||||||
import { Schedule } from './clock/Schedule'
|
import { Schedule } from './clock/Schedule'
|
||||||
import { QCategoryCache } from './services/QCategoryCache'
|
import { QCategoryCache } from './services/QCategoryCache'
|
||||||
|
import { RedisClient } from './redis/RedisClient'
|
||||||
|
|
||||||
const zReqParserPlugin = require('plugins/zReqParser');
|
const zReqParserPlugin = require('plugins/zReqParser');
|
||||||
|
|
||||||
@ -93,6 +94,9 @@ export class ApiServer {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.log(`DB Connection Error: ${err.message}`);
|
logger.log(`DB Connection Error: ${err.message}`);
|
||||||
}
|
}
|
||||||
|
let opts = {url: config.redis}
|
||||||
|
new RedisClient(opts)
|
||||||
|
logger.log('REDIS Connected')
|
||||||
}
|
}
|
||||||
private setErrHandler() {
|
private setErrHandler() {
|
||||||
this.server.setNotFoundHandler(function(request: any, reply: { send: (arg0: { errcode: number; errmsg: string; }) => void; }){
|
this.server.setNotFoundHandler(function(request: any, reply: { send: (arg0: { errcode: number; errmsg: string; }) => void; }){
|
||||||
|
@ -35,7 +35,8 @@ let baseConfig = {
|
|||||||
token_expiresIn: process.env.ADMIN_TOKEN_EXPIRESIN
|
token_expiresIn: process.env.ADMIN_TOKEN_EXPIRESIN
|
||||||
},
|
},
|
||||||
db_main:process.env.DB_MAIN,
|
db_main:process.env.DB_MAIN,
|
||||||
db_second:process.env.DB_SECOND
|
db_second:process.env.DB_SECOND,
|
||||||
|
redis: process.env.REDIS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user