Don't delete redis keys because they take time to rebuild and subs can be counted incorrectly during that time.

This commit is contained in:
Samuel Clay 2022-08-10 17:45:25 -04:00
parent e06147aa71
commit cdf5a36b81
2 changed files with 5 additions and 3 deletions

View file

@ -2901,8 +2901,11 @@ class MStory(mongo.Document):
r = redis.Redis(connection_pool=settings.REDIS_STORY_HASH_POOL)
feed = Feed.get_by_id(story_feed_id)
stories = cls.objects.filter(story_feed_id=story_feed_id, story_date__gte=feed.unread_cutoff)
r.delete('F:%s' % story_feed_id)
r.delete('zF:%s' % story_feed_id)
# Don't delete redis keys because they take time to rebuild and subs can
# be counted incorrectly during that time.
# r.delete('F:%s' % story_feed_id)
# r.delete('zF:%s' % story_feed_id)
logging.info(" ---> [%-30s] ~FMSyncing ~SB%s~SN stories to redis" % (feed and feed.log_title[:30] or story_feed_id, stories.count()))
p = r.pipeline()

View file

@ -964,7 +964,6 @@ class FeedFetcherWorker:
' ---> [%-30s] ~FBPerforming feed cleanup...' % (feed.log_title[:30],)
)
start_cleanup = time.time()
feed.sync_redis()
feed.count_fs_size_bytes()
logging.debug(
' ---> [%-30s] ~FBDone with feed cleanup. Took ~SB%.4s~SN sec.'