connect-redis
Advanced tools
Comparing version 1.4.4 to 1.4.5
1.4.5 / 2012-11-02 | ||
================== | ||
* revert to redis 0.7.x which actually works... | ||
1.4.4 / 2012-09-12 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -1,2 +0,1 @@ | ||
/*! | ||
@@ -94,10 +93,12 @@ * Connect - Redis | ||
if (err) return fn(err); | ||
if (!data) return fn(); | ||
var result; | ||
data = data.toString(); | ||
debug('GOT %s', data); | ||
try { | ||
if (!data) return fn(); | ||
data = data.toString(); | ||
debug('GOT %s', data); | ||
fn(null, JSON.parse(data)); | ||
result = JSON.parse(data); | ||
} catch (err) { | ||
fn(err); | ||
} | ||
return fn(err); | ||
} | ||
return fn(null, result); | ||
}); | ||
@@ -126,3 +127,3 @@ }; | ||
debug('SETEX "%s" ttl:%s %s', sid, sess); | ||
debug('SETEX "%s" ttl:%s %s', sid, ttl, sess); | ||
this.client.setex(sid, ttl, sess, function(err){ | ||
@@ -129,0 +130,0 @@ err || debug('SETEX complete'); |
{ | ||
"name": "connect-redis", | ||
"description": "Redis session store for Connect", | ||
"version": "1.4.4", | ||
"version": "1.4.5", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
"main": "./index.js", | ||
"dependencies": { "redis": "0.8.1", "debug": "*" }, | ||
"dependencies": { "redis": "0.7.x", "debug": "*" }, | ||
"devDependencies": { "connect": "*" }, | ||
"engines": { "node": "*" } | ||
} |
11
test.js
@@ -18,3 +18,3 @@ | ||
assert.ok(ok, '#set() is not ok'); | ||
// #get() | ||
@@ -24,3 +24,3 @@ store.get('123', function(err, data){ | ||
assert.deepEqual({ cookie: { maxAge: 2000 }, name: 'tj' }, data); | ||
// #set null | ||
@@ -34,4 +34,9 @@ store.set('123', { cookie: { maxAge: 2000 }, name: 'tj' }, function(){ | ||
}); | ||
}) | ||
throw new Error('Error in fn'); | ||
}); | ||
}); | ||
}); | ||
process.once('uncaughtException', function (err) { | ||
assert.ok(err.message === 'Error in fn', '#get() catch wrong error'); | ||
}); |
19042
170
+ Addedredis@0.7.3(transitive)
- Removedredis@0.8.1(transitive)
Updatedredis@0.7.x