Throttle feed loading to avoid YouTube rate limits #11743
Merged
+27
−1
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=50
channel 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_EXTRACTIONS
from 6 to 3, as suggested by AudricV. The value ofBATCH_SIZE
was chosen because people reported problems starting from ~100 subscriptions, so 50 should be safe.Before/After Screenshots/Screen Record
In this video
BATCH_SIZE=10
andDELAY_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