diff options
author | randomdan <randomdan@localhost> | 2011-11-28 00:18:53 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-11-28 00:18:53 +0000 |
commit | 66f4d13cff6dc3135f5907c793827070752996e9 (patch) | |
tree | 6bcb7a175b2bf61c1f1e81d753f2b01894792d8d | |
parent | New memoryCache implementation (diff) | |
download | project2-66f4d13cff6dc3135f5907c793827070752996e9.tar.bz2 project2-66f4d13cff6dc3135f5907c793827070752996e9.tar.xz project2-66f4d13cff6dc3135f5907c793827070752996e9.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.cpp | 2 |
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)); |