diff --git a/apps/reader/models.py b/apps/reader/models.py index 5bcc6c4d0..8464d5755 100644 --- a/apps/reader/models.py +++ b/apps/reader/models.py @@ -350,8 +350,11 @@ class UserSubscription(models.Model): @classmethod def truncate_river(cls, user_id, feed_ids, read_filter, cache_prefix=""): - rt = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_TEMP_POOL) - + if cache_prefix: + rt = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_SECONDARY_POOL) + else: + rt = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_POOL) + feeds_string = ','.join(str(f) for f in sorted(feed_ids))[:30] ranked_stories_keys = '%szU:%s:feeds:%s' % (cache_prefix, user_id, feeds_string) unread_ranked_stories_keys = '%szhU:%s:feeds:%s' % (cache_prefix, user_id, feeds_string) diff --git a/apps/social/models.py b/apps/social/models.py index 2b62e679b..f4fc3abad 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -1112,7 +1112,7 @@ class MSocialSubscription(mongo.Document): def feed_stories(cls, user_id, social_user_ids, offset=0, limit=6, order='newest', read_filter='all', relative_user_id=None, cache=True, socialsubs=None, cutoff_date=None, dashboard_global=False): - rt = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_TEMP_POOL) + rt = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_POOL) if not relative_user_id: relative_user_id = user_id diff --git a/newsblur_web/settings.py b/newsblur_web/settings.py index 1ea362b36..e2c9ad0fe 100644 --- a/newsblur_web/settings.py +++ b/newsblur_web/settings.py @@ -795,7 +795,6 @@ REDIS_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port= REDIS_ANALYTICS_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port=REDIS_PORT, db=2, decode_responses=True) REDIS_STATISTICS_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port=REDIS_PORT, db=3, decode_responses=True) REDIS_FEED_UPDATE_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port=REDIS_PORT, db=4, decode_responses=True) -REDIS_STORY_HASH_TEMP_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port=REDIS_PORT, db=10, decode_responses=True) # REDIS_CACHE_POOL = redis.ConnectionPool(host=REDIS_USER['host'], port=REDIS_PORT, db=6) # Duped in CACHES REDIS_STORY_HASH_POOL = redis.ConnectionPool(host=REDIS_STORY['host'], port=REDIS_PORT, db=1, decode_responses=True) REDIS_STORY_HASH_SECONDARY_POOL = redis.ConnectionPool(host=REDIS_STORY_SECONDARY['host'], port=REDIS_STORY_SECONDARY['port'], db=1, decode_responses=True)