Permalink
Browse files

Update to use new node-redis-raw api

the new api wraps the redis object instead of the internal redis instance. Also the api allows us to keep updating the redis versions.
And it works.
  • Loading branch information...
sreeix committed Apr 8, 2013
1 parent 666f822 commit 52b6ded90d4de7aa5d60233f8bd62c69f3c060b8
Showing with 7 additions and 8 deletions.
  1. +3 −5 lib/redis_proxy.js
  2. +3 −2 lib/server.js
  3. +1 −1 package.json
View
@@ -1,5 +1,3 @@
-require('node-redis-raw');
-var redis = require('redis');
var _ = require('underscore');
var redisCommand = require('./redis_command');
var util = require('util');
@@ -8,15 +6,15 @@ var logger = require('./logging').logger;
// Acts as a proxy for a set of redis servers
// first redis becomes the master and then on failure we move to the next one in the list
-// When redis becomes the master it executes a slave of no one, and all other redises will
+// When redis becomes the master it executes a slave of no one, and all other redises will
// automatically become slave of this master.
// this is also true when the redis dies and another redis takes over.
// This should also monitor coming up of redis servers and slave them as appropriate.
var RedisProxy = module.exports = function(o){
var self = this;
- redis.debug_mode = o.debug || false;
-
+ // redis.debug_mode = o.debug || false;
+
this._active = null;
this._activeSlaves = [];
this.slaveIndex = 0;
View
@@ -1,7 +1,8 @@
var _ = require('underscore');
-require('node-redis-raw');
var redis = require('redis');
+require('node-redis-raw')(redis); // make it support raw.
+
var Pool = require('connection_pool');
var EventEmitter = require('events').EventEmitter;
@@ -127,7 +128,7 @@ Server.prototype._incrErrorCount = function(){
};
Server.prototype.ping = function(){
- var self = this;
+ var self = this;
if(!this.client){
this._setupControlClient(this.options);
} else {
View
@@ -22,7 +22,7 @@
, "winston": "0.6.2"
, "hiredis": ""
, "connection_pool": "0.0.2"
- , "node-redis-raw": "0.0.2"
+ , "node-redis-raw": "0.1.1"
, "redis": "0.8.2"
}
, "devDependencies": {

0 comments on commit 52b6ded

Please sign in to comment.