Permalink
Browse files

Adding read preference to migration.

  • Loading branch information...
1 parent 328ca6b commit e159a7223dcacc5a453699ec2f4e1b261f73e787 @samuelclay committed Mar 28, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 utils/bootstrap_story_hash.py
@@ -1,4 +1,5 @@
import time
+import pymongo
from django.conf import settings
from apps.rss_feeds.models import MStory, Feed
@@ -12,7 +13,8 @@
cp1 = time.time() - start
# if feed.active_premium_subscribers < 1: continue
stories = MStory.objects.filter(story_feed_id=f, story_hash__exists=False)\
- .only('id', 'story_feed_id', 'story_guid')
+ .only('id', 'story_feed_id', 'story_guid')\
+ .read_preference(pymongo.ReadPreference.SECONDARY)
cp2 = time.time() - start
count = 0
for story in stories:

0 comments on commit e159a72

Please sign in to comment.