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/26 19:28:01 UTC
[5/8] 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/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 <jo...@geek.net>
Authored: Mon Feb 25 20:46:56 2013 +0000
Committer: Cory Johns <jo...@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