Commit e7c98e3b authored by David Wilson's avatar David Wilson

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

parent a8684984
...@@ -108,9 +108,14 @@ def main(log_level='INFO', profiling=False): ...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment