diff piecrust/cache.py @ 876:d1095774bfcf

refactor: Fix some issues with record/cache entry collisions, add counters.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 15 Jun 2017 07:33:40 -0700
parents 4850f8c21b6e
children f2b75e4be981
line wrap: on
line diff
--- a/piecrust/cache.py	Thu Jun 15 07:32:19 2017 -0700
+++ b/piecrust/cache.py	Thu Jun 15 07:33:40 2017 -0700
@@ -191,8 +191,12 @@
             self._hits += 1
             return item
 
-        if (self.fs_cache is not None and
-                fs_cache_time is not None):
+        if self.fs_cache is not None:
+            if fs_cache_time is None:
+                raise ValueError(
+                    "No file-system cache time was given for '%s'. "
+                    "This would result in degraded performance." % key)
+
             # Try first from the file-system cache.
             fs_key = _make_fs_cache_key(key)
             if (fs_key not in self._invalidated_fs_items and