Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions graph_net/agent/parallel_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,8 @@ def _orphan_watcher():
return

while True:
try:
model_id = task_queue.get_nowait()
except queue.Empty:
model_id = task_queue.get()
if model_id is None:
break

print(f"{prefix} Extracting: {model_id}", flush=True)
Expand Down Expand Up @@ -523,6 +522,9 @@ def main() -> int:
task_queue: multiprocessing.Queue = multiprocessing.Queue()
for mid in model_ids:
task_queue.put(mid)
# Sentinel: each worker gets one None to signal shutdown
for _ in range(num_workers):
task_queue.put(None)

# --- Launch workers ---
result_queue: multiprocessing.Queue = multiprocessing.Queue()
Expand Down
Loading