def do_clean_cache(cursor=None): cacheq = Cache.all(keys_only=True) if cursor: cacheq.with_cursor(cursor) cache = cacheq.get() if not cache: return if cache.parent().kind() == 'Board': db.delete(cache) deferred.defer(do_clean_cache, cacheq.cursor(), _countdown=2)
def do_clean_cache(cursor=None): cacheq = Cache.all() if cursor: cacheq.with_cursor(cursor) cache = cacheq.get() if not cache: logging.info("stop cache clean") return if cache.parent_key().kind() == 'Board': db.delete(cache) #elif cache.parent_key().kind() == 'Thread': # restore.from_cache(cache) deferred.defer(do_clean_cache, cacheq.cursor())