allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/4] git commit: [#5403] option to disable jinja auto_reload
Date Wed, 12 Dec 2012 15:03:35 GMT
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 <dbrondsema@geek.net>
Authored: Fri Dec 7 22:47:41 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
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.


Mime
View raw message