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