From f7a795a969a40de38f51a3ec24cd2439fb9fe798 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Wed, 19 Jun 2024 17:05:36 +0300 Subject: [PATCH] Fix clear cache --- .../dnetlib/irishmonitorservice/services/CacheService.java | 3 +++ .../irishmonitorservice/services/StatsToolService.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/dnetlib/irishmonitorservice/services/CacheService.java b/src/main/java/eu/dnetlib/irishmonitorservice/services/CacheService.java index 1612929..ec02d56 100644 --- a/src/main/java/eu/dnetlib/irishmonitorservice/services/CacheService.java +++ b/src/main/java/eu/dnetlib/irishmonitorservice/services/CacheService.java @@ -44,6 +44,9 @@ public class CacheService { @Scheduled(cron = "0 0 0 * * *") // Reset cache every day at 00:00 public void clearCache() throws UnsupportedEncodingException { + this.cacheManager.getCache("funder"); + this.cacheManager.getCache("organization"); + this.cacheManager.getCache("datasource"); this.cacheManager.getCacheNames().stream() .map(this.cacheManager::getCache) .filter(Objects::nonNull) diff --git a/src/main/java/eu/dnetlib/irishmonitorservice/services/StatsToolService.java b/src/main/java/eu/dnetlib/irishmonitorservice/services/StatsToolService.java index cc9ecd5..ce8711f 100644 --- a/src/main/java/eu/dnetlib/irishmonitorservice/services/StatsToolService.java +++ b/src/main/java/eu/dnetlib/irishmonitorservice/services/StatsToolService.java @@ -30,17 +30,17 @@ public class StatsToolService { @Autowired private RestTemplate restTemplate; - @Cacheable(value = "funders") + @Cacheable(value = "funder") public List>> getFunders() throws UnsupportedEncodingException { return this.getData(this.properties.getRfo()); } - @Cacheable(value = "organizations") + @Cacheable(value = "organization") public List>> getOrganizations() throws UnsupportedEncodingException { return this.getData(this.properties.getRpo()); } - @Cacheable(value = "datasources") + @Cacheable(value = "datasource") public List>> getDataSources() throws UnsupportedEncodingException { return this.getData(this.properties.getRepository()); }