changeset 86:e47d1db5ef20

Added few options to configs, Changed error middleware. TO basic pylons behavior
author Marcin Kuzminski <marcin@python-blog.com>
date Sun, 18 Apr 2010 20:06:35 +0200
parents 4bb06ccb5bee
children 9f6300b96380
files development.ini production.ini pylons_app/config/middleware.py pylons_app/controllers/shortlog.py
diffstat 4 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Sun Apr 18 19:00:09 2010 +0200
+++ b/development.ini	Sun Apr 18 20:06:35 2010 +0200
@@ -19,7 +19,15 @@
 #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
--- a/production.ini	Sun Apr 18 19:00:09 2010 +0200
+++ b/production.ini	Sun Apr 18 20:06:35 2010 +0200
@@ -19,7 +19,15 @@
 #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
--- a/pylons_app/config/middleware.py	Sun Apr 18 19:00:09 2010 +0200
+++ b/pylons_app/config/middleware.py	Sun Apr 18 20:06:35 2010 +0200
@@ -51,10 +51,9 @@
         # 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)
--- a/pylons_app/controllers/shortlog.py	Sun Apr 18 19:00:09 2010 +0200
+++ b/pylons_app/controllers/shortlog.py	Sun Apr 18 20:06:35 2010 +0200
@@ -7,6 +7,7 @@
 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 @@
         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