James Moger
2013-11-29 3811378e0ec542e1ec3139406bbf0fc395e9d3df
Invalidate all cached repository data on "clear cache" (issue-346)

Change-Id: I14404e38bbc6f5827c430849baf3c13f4df2c6ef
3 files modified
7 ■■■■■ changed files
releases.moxie 1 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/manager/RepositoryManager.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/utils/ObjectCache.java 4 ●●●● patch | view | raw | blame | history
releases.moxie
@@ -13,6 +13,7 @@
    - Fixed support for implied SSH urls in web.otherUrls (issue-311)
    - Bind LDAP connection after establishing TLS initialization (issue-343)
    - Fixed NPE when attempting to add a permission without a registrant (issue-344)
    - Invalidate all cached repository data on "clear cache" (issue-346)
    - Fix potential NPE on removing uncached repository from cache
    - Ignore the default contents of .git/description file
    - Fix error on generating activity page when there is no activity
src/main/java/com/gitblit/manager/RepositoryManager.java
@@ -457,6 +457,8 @@
    public void resetRepositoryListCache() {
        logger.info("Repository cache manually reset");
        repositoryListCache.clear();
        repositorySizeCache.clear();
        repositoryMetricsCache.clear();
    }
    /**
src/main/java/com/gitblit/utils/ObjectCache.java
@@ -54,6 +54,10 @@
        }
    }
    public void clear() {
        cache.clear();
    }
    public boolean hasCurrent(String name, Date date) {
        return cache.containsKey(name) && cache.get(name).date.compareTo(date) == 0;
    }