mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Boosting shared stories on popular.
This commit is contained in:
parent
00179a9465
commit
e37beac718
2 changed files with 4 additions and 6 deletions
|
@ -1432,12 +1432,12 @@ class MSharedStory(mongo.Document):
|
||||||
if not days:
|
if not days:
|
||||||
days = 3
|
days = 3
|
||||||
if not cutoff:
|
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')))
|
# shared_stories_count = sum(json.decode(MStatistics.get('stories_shared')))
|
||||||
# cutoff = cutoff or max(math.floor(.025 * shared_stories_count), 3)
|
# cutoff = cutoff or max(math.floor(.025 * shared_stories_count), 3)
|
||||||
today = datetime.datetime.now() - datetime.timedelta(days=days)
|
today = datetime.datetime.now() - datetime.timedelta(days=days)
|
||||||
if not shared_feed_ids:
|
|
||||||
shared_feed_ids = []
|
|
||||||
|
|
||||||
map_f = """
|
map_f = """
|
||||||
function() {
|
function() {
|
||||||
|
|
|
@ -67,9 +67,7 @@ class SharePopularStories(Task):
|
||||||
|
|
||||||
def run(self, **kwargs):
|
def run(self, **kwargs):
|
||||||
logging.debug(" ---> Sharing popular stories...")
|
logging.debug(" ---> Sharing popular stories...")
|
||||||
shared = MSharedStory.share_popular_stories(interactive=False)
|
MSharedStory.share_popular_stories(interactive=False)
|
||||||
if not shared:
|
|
||||||
shared = MSharedStory.share_popular_stories(interactive=False, days=2)
|
|
||||||
|
|
||||||
|
|
||||||
class UpdateRecalcForSubscription(Task):
|
class UpdateRecalcForSubscription(Task):
|
||||||
|
|
Loading…
Add table
Reference in a new issue