From e01fd630ba94c0a10c37bc5c3ce09ac9a79d16be Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Tue, 6 Sep 2011 14:43:14 +0100 Subject: [PATCH] Use unixepoch instead of utc, as the datetime is stored as unixtime --- apishiv/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apishiv/cache.py b/apishiv/cache.py index 364778e..34f29ae 100644 --- a/apishiv/cache.py +++ b/apishiv/cache.py @@ -55,7 +55,7 @@ class DbCacheHandler: docid = self._gen_docid(host, path, params) self.log.debug("Retrieving document: %s" % docid) try: - self.cursor.execute("SELECT xml FROM api_cache WHERE docid = ? and datetime(cacheduntil, 'utc') >= current_timestamp", (docid,)) + self.cursor.execute("SELECT xml FROM api_cache WHERE docid = ? and datetime(cacheduntil, 'unixepoch') >= current_timestamp", (docid,)) res = self.cursor.fetchone() self.disconnect() except sqlite3.Error as e: