Add execute timeout to server; Fix error examples

This commit is contained in:
Timothyxxx
2024-03-18 20:42:57 +08:00
parent a145b97bd0
commit eeae1442cd
5 changed files with 15 additions and 22 deletions

View File

@@ -63,7 +63,7 @@ def execute_command():
# Execute the command without any safety checks.
try:
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, text=True)
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell, text=True, timeout=120)
return jsonify({
'status': 'success',
'output': result.stdout,