···498498 unique_dids = {p["did"] for p in publications if p["did"]}
499499 log(f" resolving avatars for {len(unique_dids)} unique authors...")
500500 did_avatars: dict[str, str] = {}
501501- batch_size = 25
502501 did_list = list(unique_dids)
503503- for i in range(0, len(did_list), batch_size):
504504- batch = did_list[i : i + batch_size]
505505- for did in batch:
502502+ with httpx.Client() as avatar_client:
503503+ for did in did_list:
506504 try:
507507- resp = client.get(
505505+ resp = avatar_client.get(
508506 f"https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor={did}",
509507 timeout=10,
510508 )