]> source.dussan.org Git - gitblit.git/commitdiff
Invalidate all cached repository data on "clear cache" (issue-346)
authorJames Moger <james.moger@gitblit.com>
Fri, 29 Nov 2013 17:02:58 +0000 (12:02 -0500)
committerJames Moger <james.moger@gitblit.com>
Fri, 29 Nov 2013 17:02:58 +0000 (12:02 -0500)
Change-Id: I14404e38bbc6f5827c430849baf3c13f4df2c6ef

releases.moxie
src/main/java/com/gitblit/manager/RepositoryManager.java
src/main/java/com/gitblit/utils/ObjectCache.java

index c2ad4fce3d557ef4714bc19db67a1c462cf48f06..3a1b296c882c8ebec03c3aed6ae0c37818f9b8aa 100644 (file)
@@ -13,6 +13,7 @@ r20: {
        - 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
index 438d885c092a6a563c927aecc04ba87a97720c49..0a3f6631912d0c1fc53a9f76b31469a88ace5f72 100644 (file)
@@ -457,6 +457,8 @@ public class RepositoryManager implements IRepositoryManager {
        public void resetRepositoryListCache() {
                logger.info("Repository cache manually reset");
                repositoryListCache.clear();
+               repositorySizeCache.clear();
+               repositoryMetricsCache.clear();
        }
 
        /**
index 48a9668dcba604c30561bf9d7f9f0c0af8f71704..e75d4b8680cd6b6d549ccc080b364414f73d834d 100644 (file)
@@ -54,6 +54,10 @@ public class ObjectCache<X> implements Serializable {
                }\r
        }\r
 \r
+       public void clear() {\r
+               cache.clear();\r
+       }\r
+\r
        public boolean hasCurrent(String name, Date date) {\r
                return cache.containsKey(name) && cache.get(name).date.compareTo(date) == 0;\r
        }\r