diff piecrust/commands/builtin/baking.py @ 1017:3c669bb9498e

bake: Don't cheat when profiling.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 29 Nov 2017 20:41:09 -0800
parents 8adc27285d93
children 54159951d97a
line wrap: on
line diff
--- a/piecrust/commands/builtin/baking.py	Wed Nov 29 20:38:15 2017 -0800
+++ b/piecrust/commands/builtin/baking.py	Wed Nov 29 20:41:09 2017 -0800
@@ -75,6 +75,9 @@
                 import gc
                 gc.collect()
                 logger.info("---- %d/%d ----" % (i + 1, num_iter))
+                # Don't cheat -- the app instance caches a bunch of stuff
+                # so we need to create a fresh one.
+                ctx.app = ctx.appfactory.create()
 
             try:
                 records = self._doBake(ctx, out_dir)