Fix clear cache
This commit is contained in:
parent
8e2dd89950
commit
f7a795a969
|
@ -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)
|
||||
|
|
|
@ -30,17 +30,17 @@ public class StatsToolService {
|
|||
@Autowired
|
||||
private RestTemplate restTemplate;
|
||||
|
||||
@Cacheable(value = "funders")
|
||||
@Cacheable(value = "funder")
|
||||
public List<List<List<String>>> getFunders() throws UnsupportedEncodingException {
|
||||
return this.getData(this.properties.getRfo());
|
||||
}
|
||||
|
||||
@Cacheable(value = "organizations")
|
||||
@Cacheable(value = "organization")
|
||||
public List<List<List<String>>> getOrganizations() throws UnsupportedEncodingException {
|
||||
return this.getData(this.properties.getRpo());
|
||||
}
|
||||
|
||||
@Cacheable(value = "datasources")
|
||||
@Cacheable(value = "datasource")
|
||||
public List<List<List<String>>> getDataSources() throws UnsupportedEncodingException {
|
||||
return this.getData(this.properties.getRepository());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue