diff piecrust/baking/baker.py @ 49:fce061f8c2ed

Fix cache validation issue with rendered segments, limit disk access.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 22 Aug 2014 20:26:05 -0700
parents efd0d3bacc9e
children 2fec3ee1298f
line wrap: on
line diff
--- a/piecrust/baking/baker.py	Fri Aug 22 20:25:41 2014 -0700
+++ b/piecrust/baking/baker.py	Fri Aug 22 20:26:05 2014 -0700
@@ -127,7 +127,7 @@
             do_bake = True
             if not self.force and prev_record_entry:
                 try:
-                    in_path_time = os.path.getmtime(page.path)
+                    in_path_time = page.path_mtime
                     out_path_time = os.path.getmtime(out_path)
                     if out_path_time > in_path_time:
                         do_bake = False
@@ -157,6 +157,8 @@
                 ctx, rp = self._bakeSingle(page, sub_uri, cur_sub, out_path,
                         pagination_filter, custom_data)
             except Exception as ex:
+                if self.app.debug:
+                    logger.exception(ex)
                 raise Exception("Error baking page '%s' for URL '%s'." %
                         (page.ref_spec, uri)) from ex