mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Adding pipeline for redis sync on usersub.
This commit is contained in:
parent
ede93d2117
commit
38b7ca8f12
1 changed files with 6 additions and 1 deletions
|
@ -101,8 +101,13 @@ class UserSubscription(models.Model):
|
|||
self.feed.sync_redis()
|
||||
|
||||
userstories = MUserStory.objects.filter(feed_id=self.feed_id, user_id=self.user_id)
|
||||
total = userstories.count()
|
||||
logging.debug(" ---> ~SN~FMSyncing ~SB%s~SN stories (%s)" % (total, self))
|
||||
|
||||
pipeline = r.pipeline()
|
||||
for userstory in userstories:
|
||||
userstory.sync_redis(r=r)
|
||||
userstory.sync_redis(pipeline=pipeline)
|
||||
pipeline.execute()
|
||||
|
||||
def get_stories(self, offset=0, limit=6, order='newest', read_filter='all', withscores=False):
|
||||
r = redis.Redis(connection_pool=settings.REDIS_STORY_POOL)
|
||||
|
|
Loading…
Add table
Reference in a new issue