incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [5/7] git commit: [#5788] Fixed closed session issue and added limit option for performance testing of RefreshLastCommits
Date Thu, 28 Feb 2013 21:48:56 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/fcf37e81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fcf37e81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fcf37e81

Branch: refs/heads/master
Commit: fcf37e812bff2bd29f08d0afc98facd366f69d24
Parents: 871ae8a
Author: Cory Johns <johnsca@geek.net>
Authored: Mon Feb 25 20:46:56 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Thu Feb 28 21:48:32 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/fcf37e81/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