# HG changeset patch # User Ludovic Chabant # Date 1435269072 25200 # Node ID 5feb71d31a4f1a5858730a37741a4890f877eeb0 # Parent f4f5685019a2c722980c0294b4daab6e94d4a58e internal: Fix caches being orphaned from their directory. After clearing caches, the instances in memory don't have a file-system directory anymore. This means that either caching data would crash the app, or, in the case of baking a site, would make the workers create the directory but collide randomly while doing so at the same time. diff -r f4f5685019a2 -r 5feb71d31a4f piecrust/cache.py --- a/piecrust/cache.py Thu Jun 25 08:31:24 2015 -0700 +++ b/piecrust/cache.py Thu Jun 25 14:51:12 2015 -0700 @@ -47,6 +47,10 @@ logger.debug("Cleaning cache: %s" % cache_dir) shutil.rmtree(cache_dir) + # Re-create the cache-dir because now our Cache instance points + # to a directory that doesn't exist anymore. + os.makedirs(cache_dir, 0o755) + def clearCaches(self, except_names=None): for name in self.getCacheNames(except_names=except_names): self.clearCache(name)