Mercurial > piecrust2
comparison piecrust/workerpool.py @ 500:22a230d99621
bake: Fix logging configuration for multi-processing on Windows.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 23 Jul 2015 23:04:00 -0700 |
parents | 04abc97dd3b6 |
children | 8073ae8cb164 |
comparison
equal
deleted
inserted
replaced
499:a406b75c4bea | 500:22a230d99621 |
---|---|
42 else: | 42 else: |
43 _real_worker_func(params) | 43 _real_worker_func(params) |
44 | 44 |
45 | 45 |
46 def _real_worker_func(params): | 46 def _real_worker_func(params): |
47 # In a context where `multiprocessing` is using the `spawn` forking model, | |
48 # the new process doesn't inherit anything, so we lost all our logging | |
49 # configuration here. Let's set it up again. | |
50 from piecrust.main import _pre_parse_chef_args | |
51 _pre_parse_chef_args(sys.argv[1:]) | |
52 | |
47 wid = params.wid | 53 wid = params.wid |
48 logger.debug("Worker %d initializing..." % wid) | 54 logger.debug("Worker %d initializing..." % wid) |
49 | 55 |
50 params.inqueue._writer.close() | 56 params.inqueue._writer.close() |
51 params.outqueue._reader.close() | 57 params.outqueue._reader.close() |