added redis socket support
In order to enable socket support I added another command line argument: `--sock` which can be true or false. If set to true the script will try to connect via sockets to the redis host provided via the `--redis` flag. In that case the port will be omitted.
This commit is contained in:
parent
ac5d254d68
commit
f6fa7d281a
2 changed files with 8 additions and 2 deletions
|
@ -16,8 +16,13 @@ var REDIS_PREFIX = '#scrumblr#';
|
|||
|
||||
|
||||
var db = function(callback) {
|
||||
console.log('Opening redis connection to ' + conf.host + ':' + conf.port);
|
||||
redisClient = redis.createClient(conf.port, conf.host, {});
|
||||
if (conf.sock) {
|
||||
console.log('Opening redis connection to socket ' + conf.host);
|
||||
redisClient = redis.createClient(conf.host);
|
||||
} else {
|
||||
console.log('Opening redis connection to ' + conf.host + ':' + conf.port);
|
||||
redisClient = redis.createClient(conf.port, conf.host, {});
|
||||
}
|
||||
redisClient.on("connect", function (err) {
|
||||
callback();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue