# HG changeset patch # User Marcin Kuzminski # Date 2010-04-18 18:06:35 # Node ID e47d1db5ef20bf3472862d000d30ad5366c948be # Parent 4bb06ccb5bee938e56d0c327b175cde617807940 Added few options to configs, Changed error middleware. TO basic pylons behavior diff --git a/development.ini b/development.ini --- a/development.ini +++ b/development.ini @@ -19,7 +19,15 @@ debug = true #error_message = 'mercurial crash !' [server:main] +##nr of threads to spawn threadpool_workers = 5 + +##max request before +threadpool_max_requests = 2 + +##option to use threads of process +use_threadpool = true + use = egg:Paste#http host = 127.0.0.1 port = 5000 diff --git a/production.ini b/production.ini --- a/production.ini +++ b/production.ini @@ -19,7 +19,15 @@ debug = true #error_message = 'mercurial crash !' [server:main] -threadpool_workers = 10 +##nr of threads to spawn +threadpool_workers = 5 + +##max request before +threadpool_max_requests = 2 + +##option to use threads of process +use_threadpool = true + use = egg:Paste#http host = 127.0.0.1 port = 8001 diff --git a/pylons_app/config/middleware.py b/pylons_app/config/middleware.py --- a/pylons_app/config/middleware.py +++ b/pylons_app/config/middleware.py @@ -51,10 +51,9 @@ def make_app(global_conf, full_stack=Tru # Display error documents for 401, 403, 404 status codes (and # 500 when debug is disabled) if asbool(config['debug']): - #don't handle 404, since mercurial does it for us. - app = StatusCodeRedirect(app, [400, 401, 403]) + app = StatusCodeRedirect(app) else: - app = StatusCodeRedirect(app, [400, 401, 403, 500]) + app = StatusCodeRedirect(app, [400, 401, 403, 404, 500]) # Establish the Registry for this application app = RegistryManager(app) diff --git a/pylons_app/controllers/shortlog.py b/pylons_app/controllers/shortlog.py --- a/pylons_app/controllers/shortlog.py +++ b/pylons_app/controllers/shortlog.py @@ -7,6 +7,7 @@ from pylons_app.lib.base import BaseCont from pylons_app.lib.utils import get_repo_slug from pylons_app.model.hg_model import HgModel from webhelpers.paginate import Page + log = logging.getLogger(__name__) class ShortlogController(BaseController): @@ -24,12 +25,10 @@ class ShortlogController(BaseController) cnt = repo.revisions[-1] gen = repo.get_changesets(None) repo_changesets = list(gen) - repo_changesets2 = list(gen) - repo_changesets3 = list(gen) - repo_changesets4 = list(gen) c.repo_changesets = Page(repo_changesets, page=p, item_count=cnt, items_per_page=lim) c.shortlog_data = render('shortlog_data.html') if request.params.get('partial'): return c.shortlog_data - return render('/shortlog.html') + r = render('/shortlog.html') + return r