diff options
Diffstat (limited to 'project2/json')
-rw-r--r-- | project2/json/couchSession.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/project2/json/couchSession.cpp b/project2/json/couchSession.cpp index fd0d1b0..1f6c444 100644 --- a/project2/json/couchSession.cpp +++ b/project2/json/couchSession.cpp @@ -145,8 +145,8 @@ class CustomCouchSessionLoader : public SessionContainerLoaderImpl<CouchSessionC // Create the server side search map json::Object map; Buffer mapBuf; - 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()); + mapBuf.appendf("function(doc) { var exp = doc['%s']; if (exp < %u) { emit(exp, doc._rev); } }", + CouchSessionContainer::ExpiryKey.c_str(), (unsigned int)time(NULL)); map["map"] = json::ValuePtr(new json::Value(mapBuf.str())); Glib::ustring mapStr(json::serializeObject(map)); // Create the CURL handle |