update DB table
This commit is contained in:
@@ -156,13 +156,15 @@ def run_worker():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
# Run scenario_execution.py queue_id scenario_path task_id
|
# Run scenario_execution.py queue_id scenario_path task_id
|
||||||
script_path = "./TPF/scenario_execution.py"
|
# It must be executed from TPF/Sensor_hub_repo with IDF sourced
|
||||||
cmd = f"python3 {script_path} {queue.id} {task.scenario_path} {task.id}"
|
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)
|
task_dir = os.path.join(queue_dir, task.id)
|
||||||
os.makedirs(task_dir, exist_ok=True)
|
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:
|
if ret == 0:
|
||||||
task.status = "Finished"
|
task.status = "Finished"
|
||||||
|
|||||||
Reference in New Issue
Block a user