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

...
Kai Reinhard
15.58.2018 f034a71a9357b877edc4f6bc8ceeebce1abec0a8
borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java
@@ -69,15 +69,6 @@
        return repository;
    }
    private BorgRepoConfig getBorgRepoConfig(String name) {
        for (BorgRepoConfig repoConfig : ConfigurationHandler.getConfiguration().getRepoConfigs()) {
            if (StringUtils.equals(repoConfig.getRepo(), name))
                return repoConfig;
        }
        log.error("Repo config with name '" + name + "' not found.");
        return null;
    }
    /**
     * @return the list of all repositories without the list of archives.
     */
@@ -94,9 +85,8 @@
    }
    public void clearAllCaches() {
        this.repoCacheAccess.clear();
        log.info("Clearing repositories cache (with included archives)...");
        this.repoArchivesCacheAccess.clear();
        clearRepoCacheAccess();
        clearRepoArchicesCacheAccess();
        log.info("Clearing cache with file lists of archives...");
        this.archiveFilelistCache.removeAllCacheFiles();
    }
@@ -106,6 +96,11 @@
        this.repoCacheAccess.clear();
    }
    public void clearRepoArchicesCacheAccess() {
        log.info("Clearing repositories cache (with included archives)...");
        this.repoArchivesCacheAccess.clear();
    }
    /**
     * @param idOrName
     * @return The repository including all archives.
@@ -119,7 +114,9 @@
        if (repository != null) {
            return repository;
        }
        repository = BorgCommands.list(getBorgRepoConfig(masterRepository.getName()), masterRepository);
        BorgRepoConfig repoConfig = ConfigurationHandler.getConfiguration().getRepoConfig(masterRepository.getName());
        repository = BorgCommands.list(repoConfig, masterRepository);
        if (repository == null) return null;
        repoArchivesCacheAccess.put(repository.getName(), repository);
        return repository;
    }