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 01:05:11 UTC
[1/4] 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/2c81ee8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2c81ee8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2c81ee8f
Branch: refs/heads/cj/5788
Commit: 2c81ee8ff7e62cd094a92714452fdc239d1a19f1
Parents: a5f0672
Author: Cory Johns <jo...@geek.net>
Authored: Mon Feb 25 20:46:56 2013 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Mon Feb 25 20:46:56 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/2c81ee8f/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