Turning of MapReduce on popular tags for now. Waiting until Mongodb 1.8 to get MR on item_frequencies, so I can finally shard the database.

This commit is contained in:
Samuel Clay 2011-02-05 19:37:15 -05:00
parent 72a32f1976
commit 57bb59bc4c
2 changed files with 3 additions and 3 deletions

View file

@ -422,9 +422,9 @@ class Feed(models.Model):
def save_popular_tags(self, feed_tags=None, verbose=False):
if not feed_tags:
all_tags = MStory.objects(story_feed_id=self.pk, story_tags__exists=True).item_frequencies_mr('story_tags')
all_tags = MStory.objects(story_feed_id=self.pk, story_tags__exists=True).item_frequencies('story_tags')
feed_tags = sorted([(k, v) for k, v in all_tags.items() if isinstance(v, int) and int(v) > 1],
feed_tags = sorted([(k, v) for k, v in all_tags.items() if isinstance(v, float) and int(v) > 1],
key=itemgetter(1),
reverse=True)[:25]
popular_tags = json.encode(feed_tags)

2
fabfile.py vendored
View file

@ -50,7 +50,7 @@ def deploy_full():
with cd('~/newsblur'):
run('git pull')
run('./manage.py migrate')
run('kill -HUP `cat /var/run/gunicorn/gunicorn.pid`')
run('sudo supervisorctl restart gunicorn')
@roles('app')
def staging():