summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2011-11-28 00:18:53 +0000
committerrandomdan <randomdan@localhost>2011-11-28 00:18:53 +0000
commitc3f47d211d60b6bc68cdd2b89f0ba787f6d55cc7 (patch)
tree6bcb7a175b2bf61c1f1e81d753f2b01894792d8d
parentNew memoryCache implementation (diff)
downloadproject2-c3f47d211d60b6bc68cdd2b89f0ba787f6d55cc7.tar.bz2
project2-c3f47d211d60b6bc68cdd2b89f0ba787f6d55cc7.tar.xz
project2-c3f47d211d60b6bc68cdd2b89f0ba787f6d55cc7.zip
Tweak the JS map function used to find expired sessions, even if I can't explain how this fixes it
-rw-r--r--project2/json/couchSession.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/project2/json/couchSession.cpp b/project2/json/couchSession.cpp
index fbe38f8..fd0d1b0 100644
--- a/project2/json/couchSession.cpp
+++ b/project2/json/couchSession.cpp
@@ -145,7 +145,7 @@ class CustomCouchSessionLoader : public SessionContainerLoaderImpl<CouchSessionC
// Create the server side search map
json::Object map;
Buffer mapBuf;
- mapBuf.appendf("function(doc) { var exp = doc['%s']; if (exp < (new Date().getTime() / 1000)) { emit(exp, doc._rev); } }",
+ mapBuf.appendf("function(doc) { var exp = doc['%s']; var now = (new Date().getTime() / 1000); if (exp < now) { emit(exp, doc._rev); } }",
CouchSessionContainer::ExpiryKey.c_str());
map["map"] = json::ValuePtr(new json::Value(mapBuf.str()));
Glib::ustring mapStr(json::serializeObject(map));