Return-Path: X-Original-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-allura-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9BADAD3A4 for ; Wed, 12 Dec 2012 15:03:36 +0000 (UTC) Received: (qmail 38908 invoked by uid 500); 12 Dec 2012 15:03:36 -0000 Delivered-To: apmail-incubator-allura-commits-archive@incubator.apache.org Received: (qmail 38825 invoked by uid 500); 12 Dec 2012 15:03:36 -0000 Mailing-List: contact allura-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: allura-dev@incubator.apache.org Delivered-To: mailing list allura-commits@incubator.apache.org Received: (qmail 38773 invoked by uid 99); 12 Dec 2012 15:03:36 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Dec 2012 15:03:36 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id A166E81B84A; Wed, 12 Dec 2012 15:03:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: johnsca@apache.org To: allura-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/4] git commit: [#5403] option to disable jinja auto_reload Message-Id: <20121212150335.A166E81B84A@tyr.zones.apache.org> Date: Wed, 12 Dec 2012 15:03:35 +0000 (UTC) Updated Branches: refs/heads/master 4c7b8153e -> 78888e7d3 [#5403] option to disable jinja auto_reload Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/96d239a2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/96d239a2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/96d239a2 Branch: refs/heads/master Commit: 96d239a2eca4750837ff7b83c6f2413136d7a00a Parents: 3670b2f Author: Dave Brondsema Authored: Fri Dec 7 22:47:41 2012 +0000 Committer: Cory Johns Committed: Wed Dec 12 15:02:53 2012 +0000 ---------------------------------------------------------------------- Allura/allura/config/app_cfg.py | 6 +++--- Allura/allura/model/notification.py | 5 ++++- Allura/development.ini | 3 +++ 3 files changed, 10 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/96d239a2/Allura/allura/config/app_cfg.py ---------------------------------------------------------------------- diff --git a/Allura/allura/config/app_cfg.py b/Allura/allura/config/app_cfg.py index 9c185c2..50e46fd 100644 --- a/Allura/allura/config/app_cfg.py +++ b/Allura/allura/config/app_cfg.py @@ -7,10 +7,10 @@ This file complements development/deployment.ini. Please note that **all the argument values are strings**. If you want to convert them into boolean, for example, you should use the :func:`paste.deploy.converters.asbool` function, as in:: - + from paste.deploy.converters import asbool setting = asbool(global_conf.get('the_setting')) - + """ import logging import pkg_resources @@ -76,7 +76,7 @@ class ForgeConfig(AppConfig): bcc = self._setup_bytecode_cache() jinja2_env = jinja2.Environment( loader=PackagePathLoader(), - auto_reload=self.auto_reload_templates, + auto_reload=config.auto_reload_templates, autoescape=True, bytecode_cache=bcc, extensions=['jinja2.ext.do', 'jinja2.ext.i18n']) http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/96d239a2/Allura/allura/model/notification.py ---------------------------------------------------------------------- diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py index 84c4746..99e699e 100644 --- a/Allura/allura/model/notification.py +++ b/Allura/allura/model/notification.py @@ -24,6 +24,7 @@ from pylons import c, g from tg import config import pymongo import jinja2 +from paste.deploy.converters import asbool from ming import schema as S from ming.orm import FieldProperty, ForeignIdProperty, RelationProperty, session @@ -77,7 +78,9 @@ class Notification(MappedClass): ref = RelationProperty('ArtifactReference') view = jinja2.Environment( - loader=jinja2.PackageLoader('allura', 'templates')) + loader=jinja2.PackageLoader('allura', 'templates'), + auto_reload=asbool(config.get('auto_reload_templates', True)), + ) @classmethod def post(cls, artifact, topic, **kw): http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/96d239a2/Allura/development.ini ---------------------------------------------------------------------- diff --git a/Allura/development.ini b/Allura/development.ini index e5e3021..433dc82 100644 --- a/Allura/development.ini +++ b/Allura/development.ini @@ -205,6 +205,9 @@ sqlalchemy.echo = false sqlalchemy.echo_pool = false sqlalchemy.pool_recycle = 3600 +# set this to "false" if you are deploying to production and want performance improvements +auto_reload_templates = true + # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* # Debug mode will enable the interactive debugging tool, allowing ANYONE to # execute malicious code after an exception is raised.