aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2007-11-11 01:12:10 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2007-11-11 01:12:10 +0000
commitc9908fa0f42c1e2aab016712b76ed55b1f7d8d09 (patch)
treee1cd62d5fb4280de1a8f98e631bb3e8b1756e33a /web
parentFactor out forums URL. (diff)
downloadpackages-c9908fa0f42c1e2aab016712b76ed55b1f7d8d09.tar.gz
packages-c9908fa0f42c1e2aab016712b76ed55b1f7d8d09.tar.bz2
packages-c9908fa0f42c1e2aab016712b76ed55b1f7d8d09.zip
/categories/ did not hit a cache.
Diffstat (limited to 'web')
-rw-r--r--web/controller.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/web/controller.py b/web/controller.py
index 62d8676..156b8d9 100644
--- a/web/controller.py
+++ b/web/controller.py
@@ -45,6 +45,12 @@ class Root(object):
entry_filter = filters.EntryFilters(self.database)
return entry_filter.verbumps_filter()
return self.database.mc_wrap('cache_verbumps', f, time=300)
+
+ @property
+ def cache_categories(self):
+ def f():
+ return self.database.get_category_list()
+ return self.database.mc_wrap('cache_categories', f, time=300)
@cherrypy.expose
@template.expire_on_30_min()
@@ -254,7 +260,7 @@ class Root(object):
left_daycount = filters.limit_leftcount(kwds)
arches = filters.limit_arches(kwds)
- categories_raw = db.get_category_list()
+ categories_raw = self.cache_categories
cols = 5
total_len = len(categories_raw)
table_rows = int(math.floor(total_len / cols))