Mercurial > piecrust2
comparison piecrust/baking/worker.py @ 476:27e3b3f05648
bake: Set the worker ID in the configuration. It's useful.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 19 Jul 2015 17:01:38 -0700 |
parents | 5b57a189fd98 |
children | 3ceeca7bb71c |
comparison
equal
deleted
inserted
replaced
475:c5df200354e8 | 476:27e3b3f05648 |
---|---|
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) | 44 app.config.set('baker/is_baking', True) |
45 app.config.set('baker/worker_id', self.wid) | |
45 app.env.base_asset_url_format = '%uri%' | 46 app.env.base_asset_url_format = '%uri%' |
46 app.env.fs_cache_only_for_main_page = True | 47 app.env.fs_cache_only_for_main_page = True |
47 app.env.registerTimer("BakeWorker_%d_Total" % self.wid) | 48 app.env.registerTimer("BakeWorker_%d_Total" % self.wid) |
48 app.env.registerTimer("BakeWorkerInit") | 49 app.env.registerTimer("BakeWorkerInit") |
49 app.env.registerTimer("JobReceive") | 50 app.env.registerTimer("JobReceive") |