Add test for auto reloading.
This commit is contained in:
@@ -646,7 +646,7 @@ class Sanic:
|
||||
self.is_running = True
|
||||
if workers == 1:
|
||||
if os.name == 'posix' and auto_reload and \
|
||||
os.environ.get('MAIN_PROCESS_RUNNED') != 'true':
|
||||
os.environ.get('MAIN_PROCESS_RUNNED') != 'true':
|
||||
reloader_helpers.watchdog(2)
|
||||
else:
|
||||
serve(**server_settings)
|
||||
@@ -808,7 +808,7 @@ class Sanic:
|
||||
logger.setLevel(logging.DEBUG)
|
||||
|
||||
if self.config.LOGO is not None and \
|
||||
os.environ.get('MAIN_PROCESS_RUNNED') != 'true':
|
||||
os.environ.get('MAIN_PROCESS_RUNNED') != 'true':
|
||||
logger.debug(self.config.LOGO)
|
||||
|
||||
if run_async:
|
||||
|
||||
@@ -58,10 +58,10 @@ def kill_process_children_unix(pid):
|
||||
:param pid: PID of process (process ID)
|
||||
:return: Nothing
|
||||
"""
|
||||
root_proc_path = "/proc/%s/task/%s/children" % (pid, pid)
|
||||
if not os.path.isfile(root_proc_path):
|
||||
root_process_path = "/proc/%s/task/%s/children" % (pid, pid)
|
||||
if not os.path.isfile(root_process_path):
|
||||
return
|
||||
with open(root_proc_path) as children_list_file:
|
||||
with open(root_process_path) as children_list_file:
|
||||
children_list_pid = children_list_file.read().split()
|
||||
|
||||
for child_pid in children_list_pid:
|
||||
|
||||
Reference in New Issue
Block a user