update DB table

This commit is contained in:
2025-12-28 03:22:12 +01:00
parent 69be5dfe52
commit b1bebde582

View File

@@ -156,13 +156,15 @@ def run_worker():
try:
# Run scenario_execution.py queue_id scenario_path task_id
script_path = "./TPF/scenario_execution.py"
cmd = f"python3 {script_path} {queue.id} {task.scenario_path} {task.id}"
# It must be executed from TPF/Sensor_hub_repo with IDF sourced
script_path = os.path.abspath("./TPF/scenario_execution.py")
repo_dir = os.path.abspath("./TPF/Sensor_hub_repo")
cmd = f"/bin/bash -c 'source $HOME/esp/esp-idf/export.sh && python3 {script_path} {queue.id} {task.scenario_path} {task.id}'"
task_dir = os.path.join(queue_dir, task.id)
os.makedirs(task_dir, exist_ok=True)
ret = run_command_with_logging(cmd, queue_log)
ret = run_command_with_logging(cmd, queue_log, cwd=repo_dir)
if ret == 0:
task.status = "Finished"