Throttle feed loading to avoid YouTube rate limits#11743
Merged
Stypox merged 2 commits intorelease-0.27.3from Nov 24, 2024
Merged
Throttle feed loading to avoid YouTube rate limits#11743Stypox merged 2 commits intorelease-0.27.3from
Stypox merged 2 commits intorelease-0.27.3from
Conversation
7 tasks
TobiGr
approved these changes
Nov 24, 2024
TobiGr
approved these changes
Nov 24, 2024
Contributor
TobiGr
left a comment
There was a problem hiding this comment.
code looks good, did not test the latest change
|
Member
Author
|
I tested it on my phone with BATCH_SIZE=10 and the number of subscriptions did not always increase by exactly 10, indicating that non-YouTube channels do not count towards the throttling. |
6 tasks
6 tasks
Open
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What is it?
Description of the changes in your PR
This PR introduces a delay between every
BATCH_SIZE=50channel extractions while loading the feed, to avoid YouTube rate limits and hopefully solve #11661. The delay varies in rangeDELAY_BETWEEN_BATCHES_MILLIS=(6000..12000)(on average 8s). I also loweredPARALLEL_EXTRACTIONSfrom 6 to 3, as suggested by AudricV. The value ofBATCH_SIZEwas chosen because people reported problems starting from ~100 subscriptions, so 50 should be safe.Before/After Screenshots/Screen Record
In this video
BATCH_SIZE=10andDELAY_BETWEEN_BATCHES_MILLIS=(2000..8000)for demonstration purposes.screen-20241124-140028.mp4
Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence