From: Plamen Dimitrov Date: Thu, 28 Jun 2012 09:31:53 +0000 (+0200) Subject: Cache version improvements X-Git-Url: http://developer.intra2net.com/git/?p=imap-fix-internaldate;a=commitdiff_plain;h=428052f4966a0cc002d1a4a48d4ea231419f700a Cache version improvements --- diff --git a/caching_data.py b/caching_data.py index e40c3c3..c578a3b 100644 --- a/caching_data.py +++ b/caching_data.py @@ -39,7 +39,7 @@ class CachingData: self.version, self.data = pickle.load(cachefile) if(self.version != CACHE_VERSION): logging.warning("Cache file has version %s and the script version is %s.", - self.version, self.data) + self.version, CACHE_VERSION) raise IOError logging.info("Cache version %s", self.version) logging.debug("%s users found.", len(self.data)) @@ -47,7 +47,7 @@ class CachingData: self.version = CACHE_VERSION self.data = {} with open(CACHE_FILENAME, 'wb') as cachefile: - pickle.dump((0, self.data), cachefile) + pickle.dump((self.version, self.data), cachefile) def __del__(self): # create temporary file first