Comments (4)
If you look into the Constructor of the L4J8 class you see, that there is a line which sets the CacheProvider of the DataCall.class.
I dont have much time right now, but maybe you can figure it out yourself if you inspect the DataCall code and the CacheProvider etc.
from r4j.
I looked into my code and here is a short example how to use a FileSystemCacheProvider
with custom TimeToLive times for specific endpoints.
L4J8 l4j8 = new L4J8(SecretFile.CREDS);
FileSystemCacheProvider cacheProvider = new FileSystemCacheProvider(getFilesDir().resolve(L4J8_CACHE_DIR));
CacheLifetimeHint hints = new CacheLifetimeHint();
hints.add(URLEndpoint.V3_CHAMPION_ROTATIONS, TimeUnit.DAYS.toMillis(7L)); // 1 week
cacheProvider.setTimeToLive(hints);
DataCall.setCacheProvider(cacheProvider);
from r4j.
The memory cache is kinda wonky at the moment, and does not support the cache hints properly.
As for how to set the TTL, see the comment above from manuelwaldner.
The default values are shown here https://github.com/stelar7/L4J8/blob/a639248e2509b91aee1cb64c493c4982881d24b0/src/main/java/no/stelar7/api/l4j8/basic/cache/CacheLifetimeHint.java#L38-L65
from r4j.
I have a fix for the memory cache in the works, but no ETA. Most likely late October...
from r4j.
Related Issues (20)
- Cant get tests to run/ Forbidden code HOT 2
- Cannot resolve method 'getSummonerName' in 'MatchParticipant' HOT 1
- Fixing ImageAPI.getSplashArt() methods
- Add Emerald tier type for League HOT 3
- Support for CDragon
- Support Spectators on the Tournament Codes. HOT 2
- The ENUM GameQueueType is missing Team Deathmatch HOT 1
- GameModeType "CHERRY" does not exist HOT 2
- Type: RealmSpesificEnum -> RealmSpecificEnum HOT 1
- README should mention this project's features
- Interested in refactoring or rewriting the cache?
- Support the v5 Tournament API HOT 1
- Support for queue type 490 HOT 4
- GameQueueType is missing the type 1710.0 HOT 2
- getMatchList passes an invalid count to Riot's API HOT 2
- Choosing what to cache HOT 1
- SpectatorAPI not working as exptected (gets old game) HOT 1
- Support for account-v1
- Cache issue with Account-V1 API
- Rate limit tracking while using threads HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r4j.