...
This commit is contained in:
parent
b3c5844124
commit
0b35eb3e7e
@ -18,7 +18,7 @@ const redisConfig = pomelo.app.get("redis");
|
||||
app.use(globalChannel, { globalChannel: {
|
||||
host: redisConfig.host,
|
||||
port: redisConfig.port,
|
||||
db: '0'
|
||||
db: redisConfig.db,
|
||||
}});
|
||||
|
||||
var chatRoute = function(session, msg, app, cb) {
|
||||
@ -60,7 +60,7 @@ app.configure('production|development', 'master', function() {
|
||||
const config = redisConfig;
|
||||
// cleanup redis
|
||||
const client = redis.createClient({
|
||||
url: `redis://${config.host}:${config.port}`,
|
||||
url: `redis://${config.host}:${config.port}/${config.db}`,
|
||||
});
|
||||
|
||||
client.on("error", (err) => {
|
||||
@ -69,7 +69,7 @@ app.configure('production|development', 'master', function() {
|
||||
|
||||
async function init() {
|
||||
await client.connect();
|
||||
await client.flushAll();
|
||||
await client.flushDb();
|
||||
client.disconnect();
|
||||
}
|
||||
init();
|
||||
|
@ -6,7 +6,7 @@ const { query_game, query_guild } = require("../lib/db");
|
||||
const config = pomelo.app.get("redis");
|
||||
|
||||
const client = redis.createClient({
|
||||
url: `redis://${config.host}:${config.port}`,
|
||||
url: `redis://${config.host}:${config.port}/${config.db}`,
|
||||
});
|
||||
|
||||
client.on("error", (err) => {
|
||||
|
@ -1,16 +1,19 @@
|
||||
{
|
||||
"development": {
|
||||
"host" : "192.168.100.173",
|
||||
"port" : "6379"
|
||||
"port" : "6379",
|
||||
"db" : 1
|
||||
},
|
||||
|
||||
"production": {
|
||||
"host" : "192.168.100.173",
|
||||
"port" : "6379"
|
||||
"port" : "6379",
|
||||
"db" : 0
|
||||
},
|
||||
|
||||
"dchat": {
|
||||
"host" : "192.168.100.173",
|
||||
"port" : "6379"
|
||||
"port" : "6379",
|
||||
"db" : 0
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user