ShokoAnime / ShokoServer

Repository for Shoko Server.
http://shokoanime.com/shoko-server/
MIT License
386 stars 75 forks source link

Implement TraktTV Ratelimiter - MK-II #1012

Closed krbrs closed 1 year ago

krbrs commented 1 year ago

Same as #1011 - but with a fresh repo.. I could not fix it.

Tried implementing a rate limiter to get rid of http 429 errors on syncing to Trakt. I took the limiter from TVDB and altered it a bit. TraktTV wants 1 Second delay on POST according to Apiary: https://trakt.docs.apiary.io/#introduction/rate-limiting

Maybe someone can have a look at what I did there - I guess there is room for improvement, lol

da3dsoul commented 1 year ago

Looks fine. It needs to be not a draft to merge

krbrs commented 1 year ago

I compiled a build and confirmed it is working; the only thing is, it spams the Log a bit with the throttling messages, as throttling occurs rather often (because it's only 1 sec wait). Maybe the messages can or should be suppressed (nvm, docker logs are trace, it's not seen in the regular WebUI logs)

da3dsoul commented 1 year ago

Oh I didn't get a notification that this left draft status