not failing on unexpected error, but writing them

above the progress bar
This commit is contained in:
Karma Riuk
2025-03-31 21:21:30 +02:00
parent c20f9d6a6c
commit 352758a600

View File

@ -368,14 +368,17 @@ def process_repo(
with tqdm(total=prs.totalCount, desc="Processing prs", leave=False) as pbar: with tqdm(total=prs.totalCount, desc="Processing prs", leave=False) as pbar:
for pr in prs: for pr in prs:
pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs}) pbar.set_postfix({"pr": pr.number, "# new good found": n_good_prs})
if pr.merged_at is None or not is_pull_good(pr): try:
pbar.update(1) if pr.merged_at is None or not is_pull_good(pr):
continue continue
n_good_prs += 1 n_good_prs += 1
process_pull(repo, pr, dataset, repos_dir, archive_destination, cache) process_pull(repo, pr, dataset, repos_dir, archive_destination, cache)
dataset.to_json(args.output) dataset.to_json(args.output)
pbar.update(1) except Exception as e:
tqdm.write(f"[ERROR] PR #{pr.number} in {repo.full_name}: {e}")
finally:
pbar.update(1)
def process_repos( def process_repos(