mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
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:
parent
18f7377dd3
commit
1cbbbcceaf
3 changed files with 8 additions and 8 deletions
|
@ -346,14 +346,14 @@ class UserSubscription(models.Model):
|
||||||
if stories_cached:
|
if stories_cached:
|
||||||
truncated += rt.zcard(ranked_stories_keys)
|
truncated += rt.zcard(ranked_stories_keys)
|
||||||
rt.delete(ranked_stories_keys)
|
rt.delete(ranked_stories_keys)
|
||||||
else:
|
# else:
|
||||||
logging.debug(" ***> ~FRNo stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
|
# logging.debug(" ***> ~FRNo stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
|
||||||
|
|
||||||
if unreads_cached:
|
if unreads_cached:
|
||||||
truncated += rt.zcard(unread_ranked_stories_keys)
|
truncated += rt.zcard(unread_ranked_stories_keys)
|
||||||
rt.delete(unread_ranked_stories_keys)
|
rt.delete(unread_ranked_stories_keys)
|
||||||
else:
|
# else:
|
||||||
logging.debug(" ***> ~FRNo unread stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
|
# logging.debug(" ***> ~FRNo unread stories cached, can't truncate: %s / %s" % (User.objects.get(pk=user_id), feed_ids))
|
||||||
|
|
||||||
return truncated
|
return truncated
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ def load_river_blurblog(request):
|
||||||
cutoff_date=user.profile.unread_cutoff)
|
cutoff_date=user.profile.unread_cutoff)
|
||||||
mstories = MStory.find_by_story_hashes(story_hashes)
|
mstories = MStory.find_by_story_hashes(story_hashes)
|
||||||
story_hashes_to_dates = dict(list(zip(story_hashes, story_dates)))
|
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)
|
stories = Feed.format_stories(sorted_mstories)
|
||||||
for s, story in enumerate(stories):
|
for s, story in enumerate(stories):
|
||||||
timestamp = story_hashes_to_dates[story['story_hash']]
|
timestamp = story_hashes_to_dates[story['story_hash']]
|
||||||
|
|
|
@ -102,11 +102,11 @@ NEWSBLUR.Views.DashboardRiver = Backbone.View.extend({
|
||||||
// ===========
|
// ===========
|
||||||
|
|
||||||
setup_dashboard_refresh: function() {
|
setup_dashboard_refresh: function() {
|
||||||
// if (NEWSBLUR.Globals.debug) return;
|
if (NEWSBLUR.Globals.debug) return;
|
||||||
|
|
||||||
// Reload dashboard graphs every N minutes.
|
// Reload dashboard graphs every N minutes.
|
||||||
// var reload_interval = NEWSBLUR.Globals.is_staff ? 60*1000 : 10*60*1000;
|
var reload_interval = NEWSBLUR.Globals.is_staff ? 60*1000 : 15*60*1000;
|
||||||
var reload_interval = 60*60*1000;
|
// var reload_interval = 60*60*1000;
|
||||||
// console.log(['setup_dashboard_refresh', this.refresh_interval]);
|
// console.log(['setup_dashboard_refresh', this.refresh_interval]);
|
||||||
|
|
||||||
clearTimeout(this.refresh_interval);
|
clearTimeout(this.refresh_interval);
|
||||||
|
|
Loading…
Add table
Reference in a new issue