added a time limit to the compilation process
authorroot <root@brendanfh.com>
Wed, 21 Jul 2021 04:24:06 +0000 (04:24 +0000)
committerroot <root@brendanfh.com>
Wed, 21 Jul 2021 04:24:06 +0000 (04:24 +0000)
serve.py

index decca698da7772d29a33b424c18fb775d2f7a366..be64eb4d49a0fb4462cf24dc41190ee9f081e249 100644 (file)
--- a/serve.py
+++ b/serve.py
@@ -24,7 +24,7 @@ def post_compile_onyx():
     with os.fdopen(code_file_desc, "w+b") as code_file:
         code_file.write(code.encode('utf-8'))
 
-    compile_process = subprocess.run(f"onyx -r js --no-file-contents --no-colors -o {wasm_file_name} {code_file_name}", shell=True, capture_output=True)
+    compile_process = subprocess.run(f"timeout -s KILL 10s onyx -r js --no-file-contents --no-colors -o {wasm_file_name} {code_file_name}", shell=True, capture_output=True)
 
     os.remove(code_file_name)