mirror of
https://github.com/SunRed/haste-server.git
synced 2024-11-01 01:30:21 +01:00
Support authentication for redis store if password provided
This commit is contained in:
parent
6c31389327
commit
c92ab077c0
1 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,10 @@ RedisDocumentStore.connect = function(options) {
|
||||||
var port = options.port || 6379;
|
var port = options.port || 6379;
|
||||||
var index = options.db || 0;
|
var index = options.db || 0;
|
||||||
RedisDocumentStore.client = redis.createClient(port, host);
|
RedisDocumentStore.client = redis.createClient(port, host);
|
||||||
|
// authenticate if password is provided
|
||||||
|
if (options.password) {
|
||||||
|
RedisDocumentStore.client.auth(options.password);
|
||||||
|
}
|
||||||
RedisDocumentStore.client.select(index, function(err, reply) {
|
RedisDocumentStore.client.select(index, function(err, reply) {
|
||||||
if (err) {
|
if (err) {
|
||||||
winston.error(
|
winston.error(
|
||||||
|
|
Loading…
Reference in a new issue