Skip to content

⚡ Bolt: Optimize Qobuz secret testing for faster login#59

Draft
davidjuarezdev wants to merge 1 commit intomainfrom
bolt-qobuz-secret-optimization-16929508269236089967
Draft

⚡ Bolt: Optimize Qobuz secret testing for faster login#59
davidjuarezdev wants to merge 1 commit intomainfrom
bolt-qobuz-secret-optimization-16929508269236089967

Conversation

@davidjuarezdev
Copy link
Copy Markdown
Owner

💡 What: Updated _get_valid_secret in streamrip/client/qobuz.py to use asyncio.as_completed instead of asyncio.gather. Added task cancellation for remaining requests once a valid secret is found.
🎯 Why: The previous implementation forced the application to wait for all secrets to be tested, which could include slow timeouts on invalid secrets, even if a valid secret was found quickly. This change short-circuits the wait.
📊 Impact: Reduces network I/O and significantly speeds up the login process by returning as soon as the first successful response is received. Prevents background task leakage.
🔬 Measurement: Verify by running tests (PYTHONPATH=. poetry run pytest tests) and confirming Qobuz login is faster and successfully handles multiple secrets.


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

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