Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UpdateChecker.kt: Add delay to reduce 429 Too Many Requests. #2

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

JensenVanStichel
Copy link
Contributor

@JensenVanStichel JensenVanStichel commented Aug 25, 2023

This might be a hacky way, but I'd really like a delay in updates if it means my whole library actually gets updated.

Hi, first off, I want to say I really like your app. I've added a delay between update calls to reduce the amount of 429 "Too Many Requests" errors.
I tested this a bit on an emulator with around 18 games installed and refreshing. And it had a good result, I got no 429's. While without the delay, I'd get around 3 or more. However, this amount only increases further the more games you have downloaded.

Add delay to reduce 429 Too Many Requests.
This might be a hacky way, but I'd really like a delay in updates if it means my whole library actually gets updated.
@gardenappl
Copy link
Owner

What's weird is I've already added random delays here and here. I check for an IOException caused by http errors, wait 2-5 seconds, then retry. But I guess if you instantly send a bunch of requests to itch.io then it will just reject you for a while anyway?

Ideally this should get more testing and maybe could be solved in a more elegant way (instead of retrying with random delay, move the game to the back of the queue, maybe). But for now I'll just merge this, thanks.

@gardenappl gardenappl merged commit e9938a4 into gardenappl:main Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants