allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jetm...@apache.org
Subject allura git commit: Re-use c.app in sitemap if possible. Can save some app.__init__ time, enable better within-app caching, etc
Date Mon, 30 Nov 2015 12:35:10 GMT
Repository: allura
Updated Branches:
  refs/heads/master b2b53d0c1 -> 849433079


Re-use c.app in sitemap if possible.  Can save some app.__init__ time, enable better within-app
caching, etc


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/84943307
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/84943307
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/84943307

Branch: refs/heads/master
Commit: 849433079c05aa4bcb18f0b913708061e07ba14c
Parents: b2b53d0
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Nov 25 12:10:29 2015 -0500
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon Nov 30 12:34:24 2015 +0000

----------------------------------------------------------------------
 Allura/allura/model/project.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/84943307/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 7d917f1..1dfd3a3 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -549,7 +549,11 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
                 log.exception('AppConfig %s references invalid tool %s',
                               ac._id, ac.tool_name)
                 continue
-            app = App(self, ac)
+            if c.app and c.app.config._id == ac._id:
+                # slight performance gain (depending on the app) by using the current app
if we're on it
+                app = c.app
+            else:
+                app = App(self, ac)
             if app.is_visible_to(c.user):
                 for sm in app.main_menu():
                     entry = sm.bind_app(app)


Mime
View raw message