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 2013/02/28 23:38:16 UTC
[11/20] git commit: [#5788] Fixed closed session issue and added
limit option for performance testing of RefreshLastCommits
[#5788] Fixed closed session issue and added limit option for performance testing of RefreshLastCommits
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/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/cj/5788
Commit: fcf37e812bff2bd29f08d0afc98facd366f69d24
Parents: 871ae8a
Author: Cory Johns <jo...@geek.net>
Authored: Mon Feb 25 20:46:56 2013 +0000
Committer: Tim Van Steenburgh <tv...@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