mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Expiring read story keys when switching feeds.
This commit is contained in:
parent
7e27a24b88
commit
051c46ff11
1 changed files with 26 additions and 9 deletions
|
@ -696,12 +696,21 @@ class RUserStory:
|
|||
for story_hash in story_hashes:
|
||||
_, hash_story = MStory.split_story_hash(story_hash)
|
||||
new_story_hash = "%s:%s" % (new_feed_id, hash_story)
|
||||
p.sadd("RS:%s:%s" % (user_id, new_feed_id), new_story_hash)
|
||||
p2.sadd("RS:%s:%s" % (user_id, new_feed_id), new_story_hash)
|
||||
p2.zadd("zRS:%s:%s" % (user_id, new_feed_id), new_story_hash, now)
|
||||
p.sadd("RS:%s" % (user_id), new_story_hash)
|
||||
p2.sadd("RS:%s" % (user_id), new_story_hash)
|
||||
p2.zadd("zRS:%s" % (user_id), new_story_hash, now)
|
||||
read_feed_key = "RS:%s:%s" % (user_id, new_feed_id)
|
||||
p.sadd(read_feed_key, new_story_hash)
|
||||
p2.sadd(read_feed_key, new_story_hash)
|
||||
p2.zadd('z' + read_feed_key, new_story_hash, now)
|
||||
p.expire(read_feed_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire(read_feed_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire('z' + read_feed_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
|
||||
read_user_key = "RS:%s" % (user_id)
|
||||
p.sadd(read_user_key, new_story_hash)
|
||||
p2.sadd(read_user_key, new_story_hash)
|
||||
p2.zadd('z' + read_user_key, new_story_hash, now)
|
||||
p.expire(read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire(read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire('z' + read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
|
||||
p.execute()
|
||||
p2.execute()
|
||||
|
@ -727,9 +736,17 @@ class RUserStory:
|
|||
p.sadd(rs_key, new_hash)
|
||||
p2.sadd(rs_key, new_hash)
|
||||
p2.zadd('z' + rs_key, new_hash, now)
|
||||
p.sadd("RS:%s" % sub.user.pk, new_hash)
|
||||
p2.sadd("RS:%s" % sub.user.pk, new_hash)
|
||||
p2.zadd("zRS:%s" % sub.user.pk, new_hash, now)
|
||||
p.expire(rs_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire(rs_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire('z' + rs_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
|
||||
read_user_key = "RS:%s" % sub.user.pk
|
||||
p.sadd(read_user_key, new_hash)
|
||||
p2.sadd(read_user_key, new_hash)
|
||||
p2.zadd('z' + read_user_key, new_hash, now)
|
||||
p.expire(read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire(read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
p2.expire('z' + read_user_key, settings.DAYS_OF_UNREAD*24*60*60)
|
||||
|
||||
p.execute()
|
||||
p2.execute()
|
||||
|
|
Loading…
Add table
Reference in a new issue