aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-06-03 07:29:01 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-06-03 07:29:01 +0000
commit7ee1687e820941d06a704d5dfb820af647e6eda7 (patch)
treec43bd941284ee945275edaaf6fc141d87267303f /web
parentEnable memcache for all get_ functions during rendering. Use a introspection ... (diff)
downloadpackages-7ee1687e820941d06a704d5dfb820af647e6eda7.tar.gz
packages-7ee1687e820941d06a704d5dfb820af647e6eda7.tar.bz2
packages-7ee1687e820941d06a704d5dfb820af647e6eda7.zip
Override the time arguments elsewhere, expire on every ten minute boundary instead.
Diffstat (limited to 'web')
-rw-r--r--web/model.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/model.py b/web/model.py
index 99bbc27..c683247 100644
--- a/web/model.py
+++ b/web/model.py
@@ -21,6 +21,10 @@ from web.lib.links import viewcvs_link, \
def caller_name():
"""Return the name of the function that this was called from"""
return sys._getframe(1).f_code.co_name
+
+def mc_expiretime(granularity):
+ t = time()
+ return t - (t % granularity) + granularity
def latest_per_day(cpvlist, daycount, pkgcount = 110):
"""generate list of sets with days and pv's as value"""
@@ -153,6 +157,7 @@ class PackageDB(object):
if not obj:
obj = func()
if self.mc and obj:
+ kwopts['time'] = mc_expiretime(600)
self.mc.set(key, obj, **kwopts)
return obj