rivenmedia / riven

Handle your Media Library with ease!
https://rivenmedia.github.io/wiki/
GNU General Public License v3.0
404 stars 54 forks source link

refactor: integrate rate limiting and caching into service sessions #846

Closed iPromKnight closed 3 weeks ago

iPromKnight commented 3 weeks ago

I've not enabled any caching atm - but we have the option for ANY session to have an independant sqlite cache now fully controllable with cache age etc

The service session constructor takes in parms to enable rate-limiting, caching or both ratelimiting and caching.

I've separated some API concerns from services, into separate classes, and updated all modules with the refactors

Seems to be working for me locally

Also - i've added rate limiting back to real debrid because its been updated to use the new session system.

replaced resquests class also has all unit tests added.

iPromKnight commented 3 weeks ago

The caching (if we enable caching) stores them in sqlite databases for each of the instances, so they aren't in memory

The buckets for rate limit tokens are stored in memory, but we were doing that before :)