Skip to content

Commit b0335b0

Browse files
committed
Merge pull request #339 from 3rd-Eden/333
Don't require redis by default
2 parents a1797cc + 15e1e68 commit b0335b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/stores/redis.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
var crypto = require('crypto')
1313
, Store = require('../store')
14-
, assert = require('assert')
15-
, redis = require('redis');
14+
, assert = require('assert');
1615

1716
/**
1817
* Exports the constructor.
@@ -25,6 +24,7 @@ Redis.Client = Client;
2524
* Redis store.
2625
* Options:
2726
* - nodeId (fn) gets an id that uniquely identifies this node
27+
* - redis (fn) redis constructor, defaults to redis
2828
* - redisPub (object) options to pass to the pub redis client
2929
* - redisSub (object) options to pass to the sub redis client
3030
* - redisClient (object) options to pass to the general redis client
@@ -60,6 +60,8 @@ function Redis (opts) {
6060
}
6161
}
6262

63+
var redis = opts.redis || require('redis');
64+
6365
// initialize a pubsub client and a regular client
6466
this.pub = redis.createClient(opts.redisPub);
6567
this.sub = redis.createClient(opts.redisSub);

0 commit comments

Comments
 (0)