From: root Date: Wed, 21 Jul 2021 04:24:06 +0000 (+0000) Subject: added a time limit to the compilation process X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=03b12780b37b871988bf8ff7c8d88d3fd12ac980;p=onyx-live.git added a time limit to the compilation process --- diff --git a/serve.py b/serve.py index decca69..be64eb4 100644 --- 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)