From e37beac718d730e5d6ac48323f3693c8857e624f Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Wed, 21 Aug 2013 11:56:21 -0700 Subject: [PATCH] Boosting shared stories on popular. --- apps/social/models.py | 6 +++--- apps/social/tasks.py | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/social/models.py b/apps/social/models.py index 99a548519..f9e6221c2 100644 --- a/apps/social/models.py +++ b/apps/social/models.py @@ -1432,12 +1432,12 @@ class MSharedStory(mongo.Document): if not days: days = 3 if not cutoff: - cutoff = 7 + cutoff = 6 + if not shared_feed_ids: + shared_feed_ids = [] # shared_stories_count = sum(json.decode(MStatistics.get('stories_shared'))) # cutoff = cutoff or max(math.floor(.025 * shared_stories_count), 3) today = datetime.datetime.now() - datetime.timedelta(days=days) - if not shared_feed_ids: - shared_feed_ids = [] map_f = """ function() { diff --git a/apps/social/tasks.py b/apps/social/tasks.py index d88ecdd44..1da3f8add 100644 --- a/apps/social/tasks.py +++ b/apps/social/tasks.py @@ -67,9 +67,7 @@ class SharePopularStories(Task): def run(self, **kwargs): logging.debug(" ---> Sharing popular stories...") - shared = MSharedStory.share_popular_stories(interactive=False) - if not shared: - shared = MSharedStory.share_popular_stories(interactive=False, days=2) + MSharedStory.share_popular_stories(interactive=False) class UpdateRecalcForSubscription(Task):