Chunking those mondo zadd calls.

This commit is contained in:
Samuel Clay 2013-06-28 19:17:07 -07:00
parent e37e275d7c
commit f95328a298

View file

@ -263,7 +263,8 @@ class UserSubscription(models.Model):
if not story_hashes:
return [], []
r.zadd(ranked_stories_keys, **dict(story_hashes))
for story_hash_group in chunks(story_hashes, 100):
r.zadd(ranked_stories_keys, **dict(story_hash_group))
story_hashes = range_func(ranked_stories_keys, offset, limit)
if read_filter == "unread":