mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 12:36:02 +01:00
read redis host just before connecting
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
nconf = require('nconf'),
|
||||
path = require('path'),
|
||||
express = require('express'),
|
||||
redis_socket_or_host = nconf.get('redis:host'),
|
||||
utils = require('./../../public/src/utils.js'),
|
||||
redis,
|
||||
connectRedis,
|
||||
@@ -48,6 +47,8 @@
|
||||
process.exit();
|
||||
}
|
||||
|
||||
var redis_socket_or_host = nconf.get('redis:host');
|
||||
|
||||
if (redis_socket_or_host && redis_socket_or_host.indexOf('/')>=0) {
|
||||
/* If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock */
|
||||
redisClient = redis.createClient(nconf.get('redis:host'));
|
||||
@@ -106,7 +107,7 @@
|
||||
module.close = function() {
|
||||
redisClient.quit();
|
||||
};
|
||||
|
||||
|
||||
module.helpers = module.helpers || {};
|
||||
module.helpers.redis = require('./redis/helpers');
|
||||
}(exports));
|
||||
|
||||
Reference in New Issue
Block a user