diff --git a/src/main/java/eu/m724/jarupdater/live/MetadataFacade.java b/src/main/java/eu/m724/jarupdater/live/MetadataFacade.java index 403dccf..575477a 100644 --- a/src/main/java/eu/m724/jarupdater/live/MetadataFacade.java +++ b/src/main/java/eu/m724/jarupdater/live/MetadataFacade.java @@ -1,17 +1,15 @@ package eu.m724.jarupdater.live; -import java.util.HashMap; -import java.util.List; -import java.util.concurrent.CompletableFuture; - import eu.m724.jarupdater.environment.Environment; import eu.m724.jarupdater.object.Version; +import java.util.List; +import java.util.concurrent.CompletableFuture; + public class MetadataFacade { private final Environment environment; private final MetadataDAO metadataDao; - - private final HashMap<String, CompletableFuture<Version>> cache = new HashMap<>(); + private CompletableFuture<List<String>> channels = null; public MetadataFacade(Environment environment, MetadataDAO metadataDao) { @@ -35,13 +33,7 @@ public class MetadataFacade { } public CompletableFuture<Version> getVersionMetadata(String version, boolean ignoreCache) { - if (!ignoreCache && cache.containsKey(version)) - return cache.get(version); - - CompletableFuture<Version> future = metadataDao.getMetadata(environment.getChannel(), version); - cache.put(version, future); // TODO should we cache forever? - - return future; + return metadataDao.getMetadata(environment.getChannel(), version); } public CompletableFuture<Version> getVersionMetadata(String version) {