mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
Forcing all unread counts to be counted from primary mongo.
This commit is contained in:
parent
34898004d5
commit
fa692d746c
2 changed files with 5 additions and 3 deletions
4
fabfile.py
vendored
4
fabfile.py
vendored
|
@ -456,8 +456,8 @@ def setup_mongoengine():
|
|||
with settings(warn_only=True):
|
||||
run('rm -fr mongoengine')
|
||||
run('git clone https://github.com/MongoEngine/mongoengine.git')
|
||||
sudo('rm -f /usr/local/lib/python2.7/dist-packages/mongoengine')
|
||||
sudo('rm -f /usr/local/lib/python2.7/dist-packages/mongoengine-*')
|
||||
sudo('rm -fr /usr/local/lib/python2.7/dist-packages/mongoengine')
|
||||
sudo('rm -fr /usr/local/lib/python2.7/dist-packages/mongoengine-*')
|
||||
sudo('ln -s %s /usr/local/lib/python2.7/dist-packages/mongoengine' %
|
||||
os.path.join(env.VENDOR_PATH, 'mongoengine/mongoengine'))
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import urllib2
|
|||
import xml.sax
|
||||
import redis
|
||||
import random
|
||||
import pymongo
|
||||
from django.core.cache import cache
|
||||
from django.conf import settings
|
||||
from django.db import IntegrityError
|
||||
|
@ -519,7 +520,8 @@ class Dispatcher:
|
|||
|
||||
if self.options['compute_scores']:
|
||||
stories = MStory.objects(story_feed_id=feed.pk,
|
||||
story_date__gte=UNREAD_CUTOFF)
|
||||
story_date__gte=UNREAD_CUTOFF)\
|
||||
.read_preference(pymongo.ReadPreference.PRIMARY)
|
||||
stories = Feed.format_stories(stories, feed.pk)
|
||||
logging.debug(u' ---> [%-30s] ~FYComputing scores: ~SB%s stories~SN with ~SB%s subscribers ~SN(%s/%s/%s)' % (
|
||||
feed.title[:30], len(stories), user_subs.count(),
|
||||
|
|
Loading…
Add table
Reference in a new issue