Caching enabled

This commit is contained in:
Nikolaos Laskaris 2017-11-22 10:57:51 +02:00
parent 7e4a40983e
commit e0a3f88279
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import java.util.stream.IntStream;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import com.google.common.collect.ContiguousSet; import com.google.common.collect.ContiguousSet;
import com.google.common.collect.DiscreteDomain; import com.google.common.collect.DiscreteDomain;
@ -28,6 +29,7 @@ import proxy.config.ConfigLoader;
import proxy.config.UrlConfig; import proxy.config.UrlConfig;
import proxy.config.exceptions.NoURLFound; import proxy.config.exceptions.NoURLFound;
@Service
public class RemoteFetcher { public class RemoteFetcher {
@ -49,6 +51,7 @@ public class RemoteFetcher {
@Cacheable("repositories") @Cacheable("repositories")
public List<Map<String, String>> getRepositories(String query) throws NoURLFound { public List<Map<String, String>> getRepositories(String query) throws NoURLFound {
System.out.println("NOT CACHED");
List<UrlConfig> urlConfigs = configLoader.getExternalUrls().getRepositories().getUrls(); List<UrlConfig> urlConfigs = configLoader.getExternalUrls().getRepositories().getUrls();
return getAll(urlConfigs, query); return getAll(urlConfigs, query);
} }