mirror of https://github.com/micromata/borgbackup-butler.git

...
Kai Reinhard
09.02.2018 0a7181d0d1f040a3aff9f41256171a7b1b7ba3da
borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java
@@ -1,6 +1,7 @@
package de.micromata.borgbutler.cache;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -13,8 +14,11 @@
    public static final String CACHE_DIR_NAME = ".borgbutler";
    private static ButlerCache instance = new ButlerCache();
    @Getter
    private RepoInfoCache repoInfoCache;
    @Getter
    private RepoListCache repoListCache;
    private ArchiveListCache archiveListCache;
    private List<AbstractCache> caches;
    @JsonIgnore
@@ -24,14 +28,6 @@
        return instance;
    }
    public static RepoInfoCache getRepoInfoCache() {
        return instance.repoInfoCache;
    }
    public static RepoListCache getRepoListCache() {
        return instance.repoListCache;
    }
    public void read() {
        for (AbstractCache cache : caches) {
            cache.read();
@@ -67,10 +63,9 @@
            log.info("Creating cache dir: " + cacheDir.getAbsolutePath());
            cacheDir.mkdir();
        }
        repoInfoCache = new RepoInfoCache(cacheDir);
        repoListCache = new RepoListCache(cacheDir);
        caches = new ArrayList<>();
        caches.add(repoInfoCache);
        caches.add(repoListCache);
        caches.add(repoInfoCache = new RepoInfoCache(cacheDir));
        caches.add(repoListCache = new RepoListCache(cacheDir));
        caches.add(archiveListCache = new ArchiveListCache(cacheDir));
    }
}