Mercurial > piecrust2
comparison piecrust/cache.py @ 1009:cd0345e4001e
internal: Remove debug logging for the cache class.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 26 Nov 2017 22:21:10 -0800 |
parents | f2b75e4be981 |
children | a7c43131d871 |
comparison
equal
deleted
inserted
replaced
1008:09c3d415d9e5 | 1009:cd0345e4001e |
---|---|
202 | 202 |
203 # Try first from the file-system cache. | 203 # Try first from the file-system cache. |
204 fs_key = _make_fs_cache_key(key) | 204 fs_key = _make_fs_cache_key(key) |
205 if (fs_key not in self._invalidated_fs_items and | 205 if (fs_key not in self._invalidated_fs_items and |
206 self.fs_cache.isValid(fs_key, fs_cache_time)): | 206 self.fs_cache.isValid(fs_key, fs_cache_time)): |
207 logger.debug("'%s' found in file-system cache." % key) | |
208 with self.fs_cache.openRead(fs_key, mode='rb') as fp: | 207 with self.fs_cache.openRead(fs_key, mode='rb') as fp: |
209 item = pickle.load(fp) | 208 item = pickle.load(fp) |
210 self.cache.put(key, item) | 209 self.cache.put(key, item) |
211 self._hits += 1 | 210 self._hits += 1 |
212 return item | 211 return item |
213 | 212 |
214 # Look into the mem-cache. | 213 # Look into the mem-cache. |
215 logger.debug("'%s' not found in cache, must build." % key) | |
216 item = item_maker() | 214 item = item_maker() |
217 self.cache.put(key, item) | 215 self.cache.put(key, item) |
218 self._last_access_hit = False | 216 self._last_access_hit = False |
219 self._misses += 1 | 217 self._misses += 1 |
220 self._missed_keys.append(key) | 218 self._missed_keys.append(key) |