query_cache: Only allow iteration over MAX_CACHED_ITEMS.

Items at the end of the query are almost guaranteed to be a huge jump
from those in the non-pruned part of the query.  To avoid confusion,
we'll cut off the query at MAX_CACHED_ITEMS which is still imperfect,
but better.
This commit is contained in:
Neil Williams
2012-04-28 19:44:03 -07:00
parent c03a291ccf
commit 89e0f79da3

View File

@@ -108,7 +108,7 @@ class _CachedQueryBase(object):
def __iter__(self):
self.fetch()
for x in self.data:
for x in self.data[:MAX_CACHED_ITEMS]:
yield x[0]