From 7476c8393a7429b62d5a4899636bc9650fc4f30a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Wed, 2 Feb 2011 17:12:39 +0200 Subject: [PATCH] cache objects only in memcached, not in datastore --- feedservice/urlstore.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/feedservice/urlstore.py b/feedservice/urlstore.py index a01646c..825c345 100644 --- a/feedservice/urlstore.py +++ b/feedservice/urlstore.py @@ -47,8 +47,7 @@ def from_cache(url): """ Tries to get the object for the given URL from Memcache or the Datastore """ - obj = memcache.get(url) - return obj or URLObject.all().filter('url =', url).get() + return memcache.get(url) def fetch_url(url, cached=None): @@ -75,7 +74,6 @@ def fetch_url(url, cached=None): obj.modified = parse_header_date(r.headers.dict.get('last-modified', None)) obj.etag = r.headers.dict.get('etag', None) - obj.put() memcache.set(url, obj) except urllib2.HTTPError, e: -- 2.11.4.GIT