Comparing version 1.1.0 to 1.2.0
@@ -9,3 +9,3 @@ var McRedis = require('../lib/McRedis.js'); | ||
// '10.0.0.4:6379', | ||
'10.0.0.8:6379', | ||
'10.0.0.2:6379', | ||
'10.0.0.100:6379' | ||
@@ -12,0 +12,0 @@ ]; |
@@ -65,4 +65,3 @@ var _ = require('lodash'); | ||
var conn = this._conns[server]; | ||
var valueAsJson = JSON.stringify(value); | ||
conn.set(key, valueAsJson, cb); | ||
conn.hmset(key, value, cb); | ||
}; | ||
@@ -85,3 +84,3 @@ | ||
var conn = conns[server]; | ||
conn.get(key, handle); | ||
conn.hgetall(key, handle); | ||
} | ||
@@ -88,0 +87,0 @@ }; |
@@ -14,3 +14,3 @@ var _ = require('lodash'); | ||
p.handle = function(err, valueAsJson) { | ||
p.handle = function(err, value) { | ||
this._debug('hanlde'); | ||
@@ -21,6 +21,6 @@ if (this._handled) { | ||
var cb = this._cb; | ||
if (err || valueAsJson === null) { | ||
if (err || value === null) { | ||
var connsToHanlde = this._connsToHanlde - 1; | ||
if (connsToHanlde === 0) { | ||
cb(err, valueAsJson); | ||
cb(err, value); | ||
return; | ||
@@ -32,9 +32,2 @@ } | ||
this._handled = true; | ||
var value; | ||
try { | ||
value = JSON.parse(valueAsJson); | ||
} catch (e) { | ||
cb(e); | ||
return; | ||
} | ||
cb(null, value); | ||
@@ -41,0 +34,0 @@ }; |
{ | ||
"name": "mc-redis", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5372
176