Applied idiomatic Python improvements and micro-optimizations across registries and API layer.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 20s
CI / Tests (Python 3.13) (push) Successful in 19s
CI / Tests (Python 3.14) (push) Successful in 16s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s

This commit is contained in:
2026-03-26 12:46:50 -04:00
parent 3cf93da28d
commit 0ddffe5e09
18 changed files with 192 additions and 172 deletions
+3 -3
View File
@@ -287,14 +287,14 @@ async def _download_segment(
return False
data = await seg_resp.read()
except Exception:
ctx.logger.debug(f"Network error downloading segment {seq}.", exc_info=True)
ctx.logger.debug("Network error downloading segment %d.", seq, exc_info=True)
return False
chunk_path = cache.segment_path(seq)
await asyncio.to_thread(chunk_path.write_bytes, data)
cache.add_chunk(seq)
ctx.logger.debug(f"Cached segment {seq} ({len(data)} bytes).")
ctx.logger.debug("Cached segment %d (%d bytes).", seq, len(data))
return True
@@ -344,7 +344,7 @@ async def _polling_loop(
else 2.0
)
cache.set_target_duration(poll_interval)
ctx.logger.debug(f"Initial poll interval set to {poll_interval:.1f}s.")
ctx.logger.debug("Initial poll interval set to %.1fs.", poll_interval)
pending_retries: set[int] = set()