Fix clear cache

This commit is contained in:
Konstantinos Triantafyllou 2024-06-19 17:05:36 +03:00
parent 8e2dd89950
commit f7a795a969
2 changed files with 6 additions and 3 deletions

View File

@ -44,6 +44,9 @@ public class CacheService {
@Scheduled(cron = "0 0 0 * * *") // Reset cache every day at 00:00 @Scheduled(cron = "0 0 0 * * *") // Reset cache every day at 00:00
public void clearCache() throws UnsupportedEncodingException { public void clearCache() throws UnsupportedEncodingException {
this.cacheManager.getCache("funder");
this.cacheManager.getCache("organization");
this.cacheManager.getCache("datasource");
this.cacheManager.getCacheNames().stream() this.cacheManager.getCacheNames().stream()
.map(this.cacheManager::getCache) .map(this.cacheManager::getCache)
.filter(Objects::nonNull) .filter(Objects::nonNull)

View File

@ -30,17 +30,17 @@ public class StatsToolService {
@Autowired @Autowired
private RestTemplate restTemplate; private RestTemplate restTemplate;
@Cacheable(value = "funders") @Cacheable(value = "funder")
public List<List<List<String>>> getFunders() throws UnsupportedEncodingException { public List<List<List<String>>> getFunders() throws UnsupportedEncodingException {
return this.getData(this.properties.getRfo()); return this.getData(this.properties.getRfo());
} }
@Cacheable(value = "organizations") @Cacheable(value = "organization")
public List<List<List<String>>> getOrganizations() throws UnsupportedEncodingException { public List<List<List<String>>> getOrganizations() throws UnsupportedEncodingException {
return this.getData(this.properties.getRpo()); return this.getData(this.properties.getRpo());
} }
@Cacheable(value = "datasources") @Cacheable(value = "datasource")
public List<List<List<String>>> getDataSources() throws UnsupportedEncodingException { public List<List<List<String>>> getDataSources() throws UnsupportedEncodingException {
return this.getData(this.properties.getRepository()); return this.getData(this.properties.getRepository());
} }