You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2012/10/03 23:02:51 UTC

git commit: [#5046] Reduced calls to _all_runs() to limit slow query

Updated Branches:
  refs/heads/cj/5046 [created] f037c6b9e


[#5046] Reduced calls to _all_runs() to limit slow query

Signed-off-by: Cory Johns <jo...@geek.net>


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

Branch: refs/heads/cj/5046
Commit: f037c6b9eba8ed6c2e3e50ac6079557367392c99
Parents: e846983
Author: Cory Johns <jo...@geek.net>
Authored: Wed Oct 3 19:01:27 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Wed Oct 3 19:01:27 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo_refresh.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f037c6b9/Allura/allura/model/repo_refresh.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo_refresh.py b/Allura/allura/model/repo_refresh.py
index 4f62214..4b8c1af 100644
--- a/Allura/allura/model/repo_refresh.py
+++ b/Allura/allura/model/repo_refresh.py
@@ -222,8 +222,9 @@ class CommitRunBuilder(object):
             run['commit_times'] += parent_run['commit_times']
             run['parent_commit_ids'] = parent_run['parent_commit_ids']
             run.m.save()
-            runs[p_cis[0]].m.delete()
-        for run1 in self._all_runs():
+            parent_run.m.delete()
+            del runs[p_cis[0]]
+        for run1 in runs.values():
             # if run1 is a subset of another run, delete it
             if CommitRunDoc.m.find(dict(commit_ids={'$all': run1.commit_ids},
                     _id={'$ne': run1._id})).count():