fix profiler option in configd (check_reload_status)

This commit is contained in:
Ad Schellevis 2015-02-09 17:09:04 +01:00
parent 639d099341
commit 9deebbfc1c
2 changed files with 11 additions and 3 deletions

View File

@ -80,8 +80,9 @@ if len(sys.argv) > 1 and 'console' in sys.argv[1:]:
# (https://code.google.com/p/jrfonseca/wiki/Gprof2Dot)
print ("...<ctrl><c> to stop profiling")
profile = cProfile.Profile()
profile.enable()
profile.enable(subcalls=True)
try:
proc_handler.single_threaded = True
proc_handler.run()
except KeyboardInterrupt:
pass

View File

@ -66,7 +66,8 @@ class Handler(object):
"""
self.socket_filename = socket_filename
self.config_path = config_path
self.simulation_mode =simulation_mode
self.simulation_mode = simulation_mode
self.single_threaded = False
def run(self):
""" Run process handler
@ -97,7 +98,13 @@ class Handler(object):
client_address=client_address,
action_handler=actHandler,
simulation_mode=self.simulation_mode)
cmd_thread.start()
if self.single_threaded :
# run single threaded
cmd_thread.run()
else:
# rnu threaded
cmd_thread.start()
except KeyboardInterrupt:
# exit on <ctrl><c>
raise