increase timeout

This commit is contained in:
marko-kraemer 2025-04-24 06:58:27 +01:00
parent 60e16cb8e0
commit 0d6ae9e43b
1 changed files with 15 additions and 5 deletions

View File

@ -102,29 +102,39 @@ class SandboxShellTool(SandboxToolsBase):
pdftotext input.pdf -layout 2>&1 || echo "Error processing PDF" && ls -la output.txt pdftotext input.pdf -layout 2>&1 || echo "Error processing PDF" && ls -la output.txt
</execute-command> </execute-command>
<!-- Example 6: Command with custom timeout (3 minutes) -->
<execute-command timeout="180">
python long_running_script.py
</execute-command>
<!-- Example 7: Command with custom timeout and folder -->
<execute-command folder="scripts" timeout="180">
python data_processing.py
</execute-command>
<!-- NON-BLOCKING COMMANDS: Use these for long-running operations to prevent timeouts --> <!-- NON-BLOCKING COMMANDS: Use these for long-running operations to prevent timeouts -->
<!-- Example 6: Basic non-blocking command with & operator --> <!-- Example 8: Basic non-blocking command with & operator -->
<execute-command> <execute-command>
python scraper.py --large-dataset > scraper_output.log 2>&1 & python scraper.py --large-dataset > scraper_output.log 2>&1 &
</execute-command> </execute-command>
<!-- Example 7: Run a process with nohup for immunity to hangups --> <!-- Example 9: Run a process with nohup for immunity to hangups -->
<execute-command> <execute-command>
nohup python processor.py --heavy-computation > processor.log 2>&1 & nohup python processor.py --heavy-computation > processor.log 2>&1 &
</execute-command> </execute-command>
<!-- Example 8: Starting a background process and storing its PID --> <!-- Example 10: Starting a background process and storing its PID -->
<execute-command> <execute-command>
python long_task.py & echo $! > task.pid python long_task.py & echo $! > task.pid
</execute-command> </execute-command>
<!-- Example 9: Checking if a process is still running --> <!-- Example 11: Checking if a process is still running -->
<execute-command> <execute-command>
ps -p $(cat task.pid) ps -p $(cat task.pid)
</execute-command> </execute-command>
<!-- Example 10: Killing a background process --> <!-- Example 12: Killing a background process -->
<execute-command> <execute-command>
kill $(cat task.pid) kill $(cat task.pid)
</execute-command> </execute-command>