hazelcast-store
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -16,3 +16,3 @@ 'use strict'; | ||
const noop = function(){}; | ||
const oneDay = 86400; | ||
const oneDay = 86400000; | ||
let debug; | ||
@@ -23,3 +23,3 @@ | ||
return store.ttl || (typeof maxAge === 'number' | ||
? Math.floor(maxAge / 1000) | ||
? Math.floor(maxAge) | ||
: oneDay); | ||
@@ -26,0 +26,0 @@ } |
{ | ||
"name": "hazelcast-store", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Hazelcast implementation of expressjs session store", | ||
@@ -23,3 +23,3 @@ "main": "index.js", | ||
"express-session": "^1.9.1", | ||
"hazelcast-client": "^0.4.0", | ||
"hazelcast-client": "^0.4.1", | ||
"mocha": "^3.0.2" | ||
@@ -26,0 +26,0 @@ }, |
@@ -19,3 +19,3 @@ "use strict"; | ||
"secure": true, | ||
"maxAge": 600000 | ||
"maxAge": 1000 | ||
}, | ||
@@ -128,2 +128,36 @@ "name": "sid" | ||
}); | ||
describe("test a short TTL with cookie ", function () { | ||
it("should still exist with 100 ms timeout and a maxage of 1 second", (done) => { | ||
createStore({ttl: null }, () => { | ||
assert(typeof store.client === "object"); | ||
assert.strictEqual(store.ttl, null); | ||
store.set(id, testSession, (err) => { | ||
assert.strictEqual(err, null); | ||
setTimeout(() => { | ||
store.get(id, (error, session) => { | ||
assert.strictEqual(error, null); | ||
assert.deepEqual(session, testSession); // shoudl still exist | ||
done(); | ||
}); | ||
}, 100); | ||
}); | ||
}); | ||
}); | ||
it("should not exist after a 2 second timeout and a maxage of 1 second", (done) => { | ||
setTimeout(() => { | ||
store.get(id, (error, session) => { | ||
assert.strictEqual(error, null); | ||
assert.strictEqual(session, null); // session should be gone after | ||
done(); | ||
}); | ||
}, 2000); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17663
369