Skip to content

⚡ Bolt: Use short-circuiting for Qobuz secret testing#46

Draft
davidjuarezdev wants to merge 1 commit intomainfrom
bolt/qobuz-secret-short-circuiting-12533860873228520935
Draft

⚡ Bolt: Use short-circuiting for Qobuz secret testing#46
davidjuarezdev wants to merge 1 commit intomainfrom
bolt/qobuz-secret-short-circuiting-12533860873228520935

Conversation

@davidjuarezdev
Copy link
Copy Markdown
Owner

💡 What: Replaced asyncio.gather with asyncio.as_completed when evaluating multiple potential Qobuz app secrets concurrently, actively cancelling any remaining pending requests once a valid secret is found.
🎯 Why: asyncio.gather waits for all background requests to resolve before execution resumes. When we only need the first successful match (e.g., when trying a list of potentially outdated or correct auth tokens), waiting for the rest is purely wasted latency and I/O.
📊 Impact: Considerably faster initial authentication sequence for Qobuz since it immediately returns when a working app secret is found rather than waiting for slow failing responses, saving up to ~2-3 seconds of initialization latency. It also reduces completely unnecessary network pressure.
🔬 Measurement: Verify tests run fine and no unexpected errors are raised. Check Qobuz client initialization time.


PR created automatically by Jules for task 12533860873228520935 started by @davidjuarezdev

Co-authored-by: davidjuarezdev <230496599+davidjuarezdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant