Have mitogen.main(profiling=True) effect the master process too

pull/178/head
David Wilson 7 years ago
parent a868498469
commit e7c98e3bda

@ -108,9 +108,14 @@ def main(log_level='INFO', profiling=False):
def wrapper(func): def wrapper(func):
if func.__module__ != '__main__': if func.__module__ != '__main__':
return func return func
import mitogen.master import mitogen.parent
import mitogen.utils import mitogen.utils
mitogen.core.enable_profiling()
mitogen.master.Router.profiling = profiling mitogen.master.Router.profiling = profiling
utils.log_to_file(level=log_level) utils.log_to_file(level=log_level)
return utils.run_with_router(func) return mitogen.core._profile_hook(
'main',
utils.run_with_router,
func,
)
return wrapper return wrapper

Loading…
Cancel
Save