Skip to content

Commit

Permalink
fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed Jun 4, 2024
1 parent 74d0521 commit f523fb8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions inspector/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ def write_meta(meta: Meta, file: str | os.PathLike) -> None:


def run_task(q: Queue, data_dir: str | os.PathLike) -> None:
try:
while True:
while True:
try:
task = q.get()
if not task:
break
Expand All @@ -283,11 +283,11 @@ def run_task(q: Queue, data_dir: str | os.PathLike) -> None:
for t in task.transform_output:
meta.outputs.extend(t(meta, task, task_dir, stdout, stderr))
write_meta(meta, os.path.join(data_dir, task.name, META_NAME))
except Exception:
raise
finally:
# ack the task, so run_tasks won't wait forever
q.task_done()
except Exception:
raise
finally:
# ack the task, so run_tasks won't wait forever
q.task_done()


def run_tasks(vendor, data_dir: str | os.PathLike, gpu_count: int = 0, nthreads: int = 8):
Expand Down

0 comments on commit f523fb8

Please sign in to comment.