From 03b12780b37b871988bf8ff7c8d88d3fd12ac980 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Jul 2021 04:24:06 +0000 Subject: [PATCH] added a time limit to the compilation process --- serve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.25.1