From 6b16b9487a95118a6109a2c5119d430dc1192e80 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 5 Jan 2012 13:03:00 -0600 Subject: Adjust page and content caching lengths and decorators Remove never_cache from many places now that we don't actually need it since we aren't caching by default. Adjust our cache_function decorator times be shorter values, and also randomize them a bit to make cache invalidations not all line up. Signed-off-by: Dan McGee --- main/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/models.py b/main/models.py index c54e297..d72f2c0 100644 --- a/main/models.py +++ b/main/models.py @@ -201,14 +201,14 @@ class Package(models.Model): def maintainers(self, maintainers): self._maintainers = maintainers - @cache_function(300) + @cache_function(1800) def applicable_arches(self): '''The list of (this arch) + (available agnostic arches).''' arches = set(Arch.objects.filter(agnostic=True)) arches.add(self.arch) return list(arches) - @cache_function(300) + @cache_function(119) def get_requiredby(self): """ Returns a list of package objects. An attempt will be made to keep this @@ -254,7 +254,7 @@ class Package(models.Model): trimmed.append(dep) return trimmed - @cache_function(300) + @cache_function(121) def get_depends(self): """ Returns a list of dicts. Each dict contains ('dep', 'pkg', and @@ -279,7 +279,7 @@ class Package(models.Model): deps.append({'dep': dep, 'pkg': pkg, 'providers': providers}) return deps - @cache_function(300) + @cache_function(125) def base_package(self): """ Locate the base package for this package. It may be this very package, -- cgit v1.2.3-24-g4f1b