diff --git a/lib/monitors/redismonitor.js b/lib/monitors/redismonitor.js index 8d78ae286..68144cde7 100644 --- a/lib/monitors/redismonitor.js +++ b/lib/monitors/redismonitor.js @@ -19,6 +19,10 @@ var Monitor = function(app, opts) { this.expire = opts.expire || constants.TIME.DEFAULT_REDIS_EXPIRE; this.password = opts.password || null; this.redisOpts = opts.redisOpts || {}; + this.redisOpts.reconnectOnError = function(err) { + if (err.message.indexOf('READONLY') !== -1) + return true; + }; }; module.exports = Monitor; @@ -70,7 +74,7 @@ Monitor.prototype.start = function(cb) { }; Monitor.prototype.stop = function() { - this.client.end(); + this.client.disconnect(); if (!!this.pingRedis) { this.pingRedis.end(); } @@ -202,7 +206,7 @@ var ping = function(self, client, rds) { client.end(); client = null; self.pingtimer = null; - rds.end(); + rds.disconnect(); rds = null; self.start(function() {}); } diff --git a/package.json b/package.json index dfbd15c3f..acaa677dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pomelo", - "version": "2.0.0", + "version": "2.0.1", "private": false, "homepage": "https://github.com/NetEase/pomelo", "repository": { @@ -46,7 +46,7 @@ "mqtt": "0.3.9", "node-zookeeper-client": "0.2.2", "node-uuid": "1.4.3", - "ioredis": "1.10.0", + "ioredis": "2.5.0", "redis": "0.12.1" }, "bin": {