From da5d87656f825569191cbb618be644ddd9c564e0 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 27 Oct 2024 15:09:29 +0100 Subject: [PATCH] Remove cache --- .../m724/jarupdater/live/MetadataFacade.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) 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> cache = new HashMap<>(); + private CompletableFuture> channels = null; public MetadataFacade(Environment environment, MetadataDAO metadataDao) { @@ -35,13 +33,7 @@ public class MetadataFacade { } public CompletableFuture getVersionMetadata(String version, boolean ignoreCache) { - if (!ignoreCache && cache.containsKey(version)) - return cache.get(version); - - CompletableFuture 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 getVersionMetadata(String version) {