-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
getAnimeStatistics times out frequently #269
Comments
Statistics is a sub-page that has a different serving strategy. It's cached and served rather than as the main anime page indexed in a database, then served. The 408 is a response handled from MAL - you can get a brief on why it happens and what are some best practises to resolve it client-side here: #177 (comment)
Good point 👍 |
Yes, I requested stats for 83 different shows.
Yeah that's pretty much what I'm doing. I'm caching all the Jikan responses on my end, with a TTL of at least 1 week. If Jikan returns an error, I retry the request up to 3 times. I might also set a 15 second timeout on my end, since if my program idles for 9 minutes my compute costs will increase. If I re-request after only 15 seconds, is there still a high likelihood that the second request succeeds?
Do you plan to change stats to use the database approach in future? |
It really just depends on MAL. Would suggest experimenting with the retry strategy.
Yes, though, probably not anytime soon. But we are open to discussing/working out how that could be added and any PRs meanwhile. |
Due to jikan-me/jikan-rest#269, sometimes Jikan takes a long time to report failures. To save on costs, we should timeout the request quickly and then just retry.
Over the span of 9 minutes, I made 83 requests to
GET /anime/:id/statistics
. Of these, 7 failed with "408 Request Timeout" errors.Within the same time span I made 83 requests to
GET /anime/:id
and they all succeeded. So this issue seems to affect statistics specifically.An example error response body is
A request a few minutes later for this same anime took 2 seconds to complete successfully.
A few extra notes:
The text was updated successfully, but these errors were encountered: