Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

Is there anyway to refresh the caffeine cache on certain interval wihtout adding TTL?

$
0
0

I have the code like this

cache = Caffeine.newBuilder()        .build(this::loadData)
string loadData(String key) {   return redishelpr.get(key);}

What I want is run this loadData(key) function after every 15 minutes.I got aapproach of using @Scheduled(cron = "----") annotation but I just wanted to know if there is any other approach to do it on caffeine itself ??

I saw there is something like .schdeuler() on caffeine but could not get clear idea from docs


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>