connect-dynamodb
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -0,1 +1,6 @@ | ||
0.0.5 / 2012-06-13 | ||
================== | ||
* Added session table check/creation at init | ||
0.0.2 / 2012-05-23 | ||
@@ -2,0 +7,0 @@ ================== |
@@ -55,2 +55,3 @@ | ||
}); | ||
this.table = options.table || 'sessions'; | ||
@@ -61,2 +62,9 @@ this.reapInterval = options.reapInterval || (10 * 60 * 1000); | ||
} | ||
// check if table exists, otherwise create it | ||
dynode.describeTable(options.table, function (error, info) { | ||
if (error) { | ||
dynode.createTable(options.table, console.log); | ||
} | ||
}); | ||
}; | ||
@@ -116,3 +124,3 @@ | ||
data = { | ||
_id: sid, | ||
id: sid, | ||
expires: expires, | ||
@@ -127,7 +135,7 @@ type: 'connect-session', | ||
data.sess = sess; | ||
delete data._id; | ||
delete data.id; | ||
this.client.updateItem(this.table, sid, data, fn); | ||
} else { | ||
data = { | ||
_id: sid, | ||
id: sid, | ||
expires: expires, | ||
@@ -165,3 +173,3 @@ type: 'connect-session', | ||
}, | ||
AttributesToGet : ["_id"] | ||
AttributesToGet : ["id"] | ||
}; | ||
@@ -180,3 +188,3 @@ this.client.scan(this.table, opts, function (err, data) { | ||
} else { | ||
var sid = data[index]._id; | ||
var sid = data[index].id; | ||
sid = sid.substring(self.prefix.length, sid.length); | ||
@@ -183,0 +191,0 @@ self.destroy(sid, function() { |
{ | ||
"name": "connect-dynamodb", | ||
"description": "DynamoDB session store for Connect", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"author": "Mike Carson <ca98am79@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
@@ -32,7 +32,7 @@ | ||
// AWS secretAccessKey | ||
secretAccessKey: 'SecretAccessKey' | ||
secretAccessKey: 'SecretAccessKey', | ||
// Optional. How often expired sessions should be cleaned up. | ||
// Defaults to 600000 (10 minutes). | ||
reapInterval: 600000, | ||
reapInterval: 600000 | ||
}); | ||
@@ -39,0 +39,0 @@ |
8939
217