Skip to content

Commit

Permalink
Merge pull request socketio#339 from 3rd-Eden/333
Browse files Browse the repository at this point in the history
Don't require redis by default
  • Loading branch information
rauchg committed Jul 31, 2011
2 parents a1797cc + 15e1e68 commit b0335b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/stores/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@

var crypto = require('crypto')
, Store = require('../store')
, assert = require('assert')
, redis = require('redis');
, assert = require('assert');

/**
* Exports the constructor.
Expand All @@ -25,6 +24,7 @@ Redis.Client = Client;
* Redis store.
* Options:
* - nodeId (fn) gets an id that uniquely identifies this node
* - redis (fn) redis constructor, defaults to redis
* - redisPub (object) options to pass to the pub redis client
* - redisSub (object) options to pass to the sub redis client
* - redisClient (object) options to pass to the general redis client
Expand Down Expand Up @@ -60,6 +60,8 @@ function Redis (opts) {
}
}

var redis = opts.redis || require('redis');

// initialize a pubsub client and a regular client
this.pub = redis.createClient(opts.redisPub);
this.sub = redis.createClient(opts.redisSub);
Expand Down

0 comments on commit b0335b0

Please sign in to comment.