Mercurial > piecrust2
comparison piecrust/workerpool.py @ 687:61d606fbc313
bake: Change `show-timers` to `show-stats`, add stats.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 14 Mar 2016 08:26:14 -0700 |
parents | 8073ae8cb164 |
children | 9ae9390192da |
comparison
equal
deleted
inserted
replaced
686:1a6c4c2683fd | 687:61d606fbc313 |
---|---|
83 if task_type == TASK_END: | 83 if task_type == TASK_END: |
84 logger.debug("Worker %d got end task, exiting." % wid) | 84 logger.debug("Worker %d got end task, exiting." % wid) |
85 try: | 85 try: |
86 rep = (task_type, True, wid, (wid, w.getReport())) | 86 rep = (task_type, True, wid, (wid, w.getReport())) |
87 except Exception as e: | 87 except Exception as e: |
88 logger.debug("Error getting report: %s" % e) | |
88 if params.wrap_exception: | 89 if params.wrap_exception: |
89 e = multiprocessing.ExceptionWithTraceback( | 90 e = multiprocessing.ExceptionWithTraceback( |
90 e, e.__traceback__) | 91 e, e.__traceback__) |
91 rep = (task_type, False, wid, (wid, e)) | 92 rep = (task_type, False, wid, (wid, e)) |
92 put(rep) | 93 put(rep) |
263 pool._callback(data) | 264 pool._callback(data) |
264 elif not success: | 265 elif not success: |
265 if pool._error_callback: | 266 if pool._error_callback: |
266 pool._error_callback(data) | 267 pool._error_callback(data) |
267 else: | 268 else: |
269 logger.error("Got error data:") | |
268 logger.error(data) | 270 logger.error(data) |
269 except Exception as ex: | 271 except Exception as ex: |
270 logger.exception(ex) | 272 logger.exception(ex) |
271 | 273 |
272 if task_type == TASK_JOB: | 274 if task_type == TASK_JOB: |