From a5dfe8f5117287b683671298ec14f013b2a36ef1 Mon Sep 17 00:00:00 2001 From: Nicolas Setton Date: Fri, 29 Jun 2018 13:38:48 -0400 Subject: [PATCH] Fix interruption of long processes. --- compile_server/app/process_handling.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compile_server/app/process_handling.py b/compile_server/app/process_handling.py index d2e655f..7d69a94 100644 --- a/compile_server/app/process_handling.py +++ b/compile_server/app/process_handling.py @@ -53,8 +53,10 @@ class SeparateProcess(object): def _monitor_timeout(self): """Monitor the running process, interrupting it if it takes too long""" - while not self.processes_running: + while self.processes_running: if time.time() - self.time > TIMEOUT_SECONDS: + with open(self.output_file, 'ab') as f: + f.write("") # The current process took too long, kill it self.p.kill() time.sleep(1.0)