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

Added Anidb integration soft rate limits #2556

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

anderson-oki
Copy link
Collaborator

@anderson-oki anderson-oki commented Jun 27, 2024

Description

Abusing the API daily and relying on their banned status could flag the client as abusive, and instead we should prevent reaching the limit from the client side. Added a soft limit for 200 requests per day.

@anderson-oki anderson-oki self-assigned this Jun 27, 2024
@anderson-oki anderson-oki changed the base branch from master to development June 27, 2024 02:53
@anderson-oki anderson-oki changed the title Addedd Anidb cache throttle improvement Added Anidb cache throttle improvement Jun 27, 2024
@anderson-oki anderson-oki force-pushed the feature/anidb-cache-throttle-improvement branch from 2043522 to 000a690 Compare July 1, 2024 02:35
@anderson-oki anderson-oki changed the title Added Anidb cache throttle improvement Added Anidb cache throttle improvements Jul 1, 2024
@anderson-oki anderson-oki changed the title Added Anidb cache throttle improvements Added Anidb daily limit throttling Jul 1, 2024
@anderson-oki anderson-oki marked this pull request as ready for review July 1, 2024 03:08
@anderson-oki anderson-oki marked this pull request as draft July 1, 2024 03:12
@anderson-oki anderson-oki marked this pull request as ready for review July 1, 2024 03:12
@anderson-oki anderson-oki changed the title Added Anidb daily limit throttling Added Anidb integration daily limit throttling Jul 2, 2024
@anderson-oki anderson-oki changed the title Added Anidb integration daily limit throttling Added Anidb integration daily soft limits Jul 2, 2024
@anderson-oki anderson-oki changed the title Added Anidb integration daily soft limits Added Anidb integration daily soft rate limits Jul 2, 2024
@morpheus65535
Copy link
Owner

There's no headers that provide daily remaining calls? Any rate-limiting information?

If not, I don't see anything wrong here. It would be nice to throttle just in time but if we can't and must have a soft limit.

@anderson-oki
Copy link
Collaborator Author

There's no headers that provide daily remaining calls? Any rate-limiting information?

If not, I don't see anything wrong here. It would be nice to throttle just in time but if we can't and must have a soft limit.

There is no header related to rate limits, also it seems they have some weird logic on their side, sometimes it is 300, sometimes 200, sometimes 250 per day, and once you get banned it takes between 24h and 48 hours to cooldown your IP address. However it seems if we don't reach the rate limit it cooldown in 24hours so it is much more preferable to prevent reaching the limit instead of relying on the "Banned" status they return.

Also banned is not only rate limiting, so that's why it is also handled.

@morpheus65535
Copy link
Owner

Then I see no issue merging this. Lets go!

@anderson-oki anderson-oki changed the title Added Anidb integration daily soft rate limits Added Anidb integration soft rate limits Jul 2, 2024
@anderson-oki anderson-oki merged commit 3cbfe08 into development Jul 2, 2024
2 checks passed
@anderson-oki anderson-oki deleted the feature/anidb-cache-throttle-improvement branch July 2, 2024 00:43
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.

2 participants