aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-08-28 23:06:01 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-08-28 23:06:01 +0000
commit484269514d6487cd2ddf55620a16c7ec63404012 (patch)
tree0cffff91320998baebf6664ace14336e31b5b3cb /web
parentFix memcache key for new date code. (diff)
downloadpackages-484269514d6487cd2ddf55620a16c7ec63404012.tar.gz
packages-484269514d6487cd2ddf55620a16c7ec63404012.tar.bz2
packages-484269514d6487cd2ddf55620a16c7ec63404012.zip
Missing a cache layer for date queries.
Diffstat (limited to 'web')
-rw-r--r--web/model.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/model.py b/web/model.py
index 39de032..41d6e8e 100644
--- a/web/model.py
+++ b/web/model.py
@@ -314,6 +314,13 @@ class PackageDB(object):
return self._get_latest_cpvs_by_pkgname(pkgname, limit)
return self.mc_wrap(key, f)
+ def get_latest_cpvs_by_date(self, date, limit=None):
+ """return new cpvs since date"""
+ key = '%s_%s_%s' % (caller_name(), strftime("%Y%m%d",date), limit)
+ def f():
+ return self._get_latest_cpvs_by_date(date, limit)
+ return self.mc_wrap(key, f)
+
sql['SELECT_get_latest_cpvs_by_date'] = """
SELECT __CPV__, verbumps.mtime
FROM verbumps
@@ -325,7 +332,7 @@ class PackageDB(object):
ORDER by verbumps.mtime DESC
LIMIT 0, ?
"""
- def get_latest_cpvs_by_date(self, date, limit=None):
+ def _get_latest_cpvs_by_date(self, date, limit=None):
"""return new cpvs since date"""
# We cannot rely on the contents of ChangeLog here
# otherwise we could add this bit of magic: