Upping feed fetching by quite a bit.

This commit is contained in:
Samuel Clay 2013-03-29 14:14:29 -07:00
parent d510a407d9
commit aa4bf71b34
3 changed files with 7 additions and 6 deletions

View file

@ -1245,14 +1245,13 @@ class Feed(models.Model):
slow_punishment = 6 * self.last_load_time
total = max(10, int(updates_per_day_delay + subscriber_bonus + slow_punishment))
if self.active_premium_subscribers > 5:
if self.active_premium_subscribers > 4:
total = min(total, 60) # 1 hour minimum for premiums
if ((self.stories_last_month == 0 or self.average_stories_per_month == 0)):
total = total * random.randint(1, 24)
if self.is_push:
total = total * 20
elif ((self.stories_last_month == 0 or self.average_stories_per_month == 0)):
total = total * random.randint(1, 24)
# 1 month max
if total > 60*24*30:

View file

@ -29,7 +29,7 @@ class TaskFeeds(Task):
next_scheduled_update__lte=now,
active=True,
active_subscribers__gte=1
).order_by('?')[:600]
).order_by('?')[:800]
active_count = feeds.count()
# Force refresh feeds

View file

@ -1,7 +1,7 @@
import stripe, datetime, time
stripe.api_key = settings.STRIPE_SECRET
week = (datetime.datetime.now() - datetime.timedelta(days=7)).strftime('%s')
week = (datetime.datetime.now() - datetime.timedelta(days=14)).strftime('%s')
failed = []
limit = 100
offset = 0
@ -29,6 +29,8 @@ while True:
user.profile.activate_premium()
elif user.payments.all().count() != 1:
user.profile.setup_premium_history()
elif user.profile.premium_expire > datetime.datetime.now() + datetime.timedelta(days=365):
user.profile.setup_premium_history()
else:
print " ---> %s is fine" % username
except stripe.APIConnectionError: