Reversing social/river_stories due to change in comparison of sorted lists (the old way used a b-a comparator, which is backwards to timestamps.

This commit is contained in:
Samuel Clay 2020-12-15 18:23:48 -05:00
parent 18f7377dd3
commit 1cbbbcceaf
3 changed files with 8 additions and 8 deletions

View file

@ -346,14 +346,14 @@ class UserSubscription(models.Model):
if stories_cached:
truncated += rt.zcard(ranked_stories_keys)
rt.delete(ranked_stories_keys)
else:
logging.debug(" ***> ~FRNo stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
# else:
# logging.debug(" ***> ~FRNo stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
if unreads_cached:
truncated += rt.zcard(unread_ranked_stories_keys)
rt.delete(unread_ranked_stories_keys)
else:
logging.debug(" ***> ~FRNo unread stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
# else:
# logging.debug(" ***> ~FRNo unread stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
return truncated

View file

@ -226,7 +226,7 @@ def load_river_blurblog(request):
cutoff_date=user.profile.unread_cutoff)
mstories = MStory.find_by_story_hashes(story_hashes)
story_hashes_to_dates = dict(list(zip(story_hashes, story_dates)))
sorted_mstories = sorted(mstories, key=lambda x: int(story_hashes_to_dates[str(x.story_hash)]))
sorted_mstories = reversed(sorted(mstories, key=lambda x: int(story_hashes_to_dates[str(x.story_hash)])))
stories = Feed.format_stories(sorted_mstories)
for s, story in enumerate(stories):
timestamp = story_hashes_to_dates[story['story_hash']]

View file

@ -102,11 +102,11 @@ NEWSBLUR.Views.DashboardRiver = Backbone.View.extend({
// ===========
setup_dashboard_refresh: function() {
// if (NEWSBLUR.Globals.debug) return;
if (NEWSBLUR.Globals.debug) return;
// Reload dashboard graphs every N minutes.
// var reload_interval = NEWSBLUR.Globals.is_staff ? 60*1000 : 10*60*1000;
var reload_interval = 60*60*1000;
var reload_interval = NEWSBLUR.Globals.is_staff ? 60*1000 : 15*60*1000;
// var reload_interval = 60*60*1000;
// console.log(['setup_dashboard_refresh', this.refresh_interval]);
clearTimeout(this.refresh_interval);