mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
02bfb62a9d
1 changed files with 6 additions and 3 deletions
|
@ -1290,6 +1290,7 @@ def load_river_stories__redis(request):
|
|||
"read_filter": read_filter,
|
||||
"usersubs": usersubs,
|
||||
"cutoff_date": user.profile.unread_cutoff,
|
||||
"cache_prefix": "dashboard:" if initial_dashboard else "",
|
||||
}
|
||||
story_hashes, unread_feed_story_hashes = UserSubscription.feed_stories(**params)
|
||||
else:
|
||||
|
@ -1408,9 +1409,11 @@ def load_river_stories__redis(request):
|
|||
# Clean stories to remove potentially old stories on dashboard
|
||||
if initial_dashboard:
|
||||
new_stories = []
|
||||
month_ago = datetime.datetime.utcnow() - datetime.timedelta(days=settings.DAYS_OF_UNREAD)
|
||||
now = datetime.datetime.utcnow()
|
||||
hour = now + datetime.timedelta(hours=1)
|
||||
month_ago = now - datetime.timedelta(days=settings.DAYS_OF_UNREAD)
|
||||
for story in stories:
|
||||
if story['story_date'] >= month_ago:
|
||||
if story['story_date'] >= month_ago and story['story_date'] < hour:
|
||||
new_stories.append(story)
|
||||
stories = new_stories
|
||||
|
||||
|
@ -1444,7 +1447,7 @@ def complete_river(request):
|
|||
read_filter=read_filter)
|
||||
feed_ids = [sub.feed_id for sub in usersubs]
|
||||
if feed_ids:
|
||||
stories_truncated = UserSubscription.truncate_river(user.pk, feed_ids, read_filter)
|
||||
stories_truncated = UserSubscription.truncate_river(user.pk, feed_ids, read_filter, cache_prefix="dashboard:")
|
||||
|
||||
logging.user(request, "~FC~BBRiver complete on page ~SB%s~SN, truncating ~SB%s~SN stories from ~SB%s~SN feeds" % (page, stories_truncated, len(feed_ids)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue