incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [5/8] git commit: [#5788] Fixed closed session issue and added limit option for performance testing of RefreshLastCommits
Date Tue, 26 Feb 2013 18:28:01 GMT
[#5788] Fixed closed session issue and added limit option for performance testing of RefreshLastCommits

Signed-off-by: Cory Johns <johnsca@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/aced1172
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/aced1172
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/aced1172

Branch: refs/heads/cj/5788
Commit: aced117225492af315ae91a6f53d814f82f0a9f5
Parents: 078e48f
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Feb 25 20:46:56 2013 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Tue Feb 26 18:27:50 2013 +0000

----------------------------------------------------------------------
 Allura/allura/scripts/refresh_last_commits.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/aced1172/Allura/allura/scripts/refresh_last_commits.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/refresh_last_commits.py b/Allura/allura/scripts/refresh_last_commits.py
index b665d99..ac924f3 100644
--- a/Allura/allura/scripts/refresh_last_commits.py
+++ b/Allura/allura/scripts/refresh_last_commits.py
@@ -55,6 +55,8 @@ class RefreshLastCommits(ScriptTask):
                 default=False, help='Log names of projects that would have their ')
         parser.add_argument('--diffs', action='store_true', dest='diffs',
                 default=False, help='Refresh / clean diffs as well as LCDs')
+        parser.add_argument('--limit', action='store', type=int, dest='limit',
+                default=False, help='Limit of how many commits to process')
         return parser
 
     @classmethod
@@ -111,7 +113,6 @@ class RefreshLastCommits(ScriptTask):
                         c.app.repo.status = 'ready'
                         session(c.app.repo).flush(c.app.repo)
             ThreadLocalORMSession.flush_all()
-            ThreadLocalORMSession.close_all()
 
     @classmethod
     def refresh_repo_lcds(cls, commit_ids, options):
@@ -143,6 +144,8 @@ class RefreshLastCommits(ScriptTask):
                 ThreadLocalORMSession.flush_all()
             if i % 100 == 0:
                 cls._print_stats(i, timings, 100)
+            if i >= options.limit:
+                break
         ThreadLocalORMSession.flush_all()
 
     @classmethod


Mime
View raw message