allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [05/10] allura git commit: [#7873] Clear cache for branches/tags on repo_refresh
Date Thu, 25 Jun 2015 16:27:01 GMT
[#7873] Clear cache for branches/tags on repo_refresh


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/0e0de67e
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/0e0de67e
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/0e0de67e

Branch: refs/heads/master
Commit: 0e0de67ed1c9eaec2f5fd3a0bb4411be63b0c7db
Parents: 22fc5d9
Author: Heith Seewald <hseewald@slashdotmedia.com>
Authored: Mon Jun 15 08:12:17 2015 -0400
Committer: Heith Seewald <hseewald@slashdotmedia.com>
Committed: Thu Jun 25 14:10:57 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/0e0de67e/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index fca220f..74e79ba 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -124,6 +124,15 @@ def refresh_repo(repo, all_commits=False, notify=True, new_clone=False):
             if (i + 1) % 100 == 0:
                 log.info('Compute last commit info %d: %s', (i + 1), ci._id)
 
+    # Clear any existing caches for branches/tags
+    if repo.cached_branches:
+        repo.cached_branches = []
+        session(repo).flush()
+
+    if repo.cached_tags:
+        repo.cached_tags = []
+        session(repo).flush()
+
     if not all_commits and not new_clone:
         for commit in commit_ids:
             new = repo.commit(commit)


Mime
View raw message