Mercurial > piecrust2
comparison piecrust/baking/worker.py @ 471:5b57a189fd98
bug: Correctly setup the environment/app for bake workers.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 14 Jul 2015 23:13:16 -0700 |
parents | 456db44dcc53 |
children | 27e3b3f05648 |
comparison
equal
deleted
inserted
replaced
470:c582746cb7eb | 471:5b57a189fd98 |
---|---|
39 | 39 |
40 def initialize(self): | 40 def initialize(self): |
41 # Create the app local to this worker. | 41 # Create the app local to this worker. |
42 app = PieCrust(self.ctx.root_dir, debug=self.ctx.debug) | 42 app = PieCrust(self.ctx.root_dir, debug=self.ctx.debug) |
43 app._useSubCacheDir(self.ctx.sub_cache_dir) | 43 app._useSubCacheDir(self.ctx.sub_cache_dir) |
44 app.config.set('baker/is_baking', True) | |
45 app.env.base_asset_url_format = '%uri%' | |
44 app.env.fs_cache_only_for_main_page = True | 46 app.env.fs_cache_only_for_main_page = True |
45 app.env.registerTimer("BakeWorker_%d_Total" % self.wid) | 47 app.env.registerTimer("BakeWorker_%d_Total" % self.wid) |
46 app.env.registerTimer("BakeWorkerInit") | 48 app.env.registerTimer("BakeWorkerInit") |
47 app.env.registerTimer("JobReceive") | 49 app.env.registerTimer("JobReceive") |
48 apply_variant_and_values(app, self.ctx.config_variant, | 50 apply_variant_and_values(app, self.ctx.config_variant, |