From c1b7877f4bbafe95a5c95037aa5d8433fb53e324 Mon Sep 17 00:00:00 2001 From: Jason Schwarzenberger Date: Mon, 9 Nov 2020 17:54:50 +1300 Subject: [PATCH] remove limit. --- apiserver/database.py | 3 +-- apiserver/feed.py | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/apiserver/database.py b/apiserver/database.py index bdbd81d..5f0e659 100644 --- a/apiserver/database.py +++ b/apiserver/database.py @@ -79,8 +79,7 @@ def get_stories(maxage=60*60*24*2): join(Story).\ filter(Story.title != None).\ filter(Story.meta['date'] > time).\ - order_by(Story.meta['date'].desc()).\ - limit(amount) + order_by(Story.meta['date'].desc()) return [x[1] for x in q] def put_ref(ref, sid, source): diff --git a/apiserver/feed.py b/apiserver/feed.py index dd4bc2c..dab64a5 100644 --- a/apiserver/feed.py +++ b/apiserver/feed.py @@ -12,11 +12,7 @@ import settings from feeds import hackernews, reddit, tildes, substack, manual, news from scrapers import outline, declutter, local -ONE_HOUR = 60*60 -ONE_DAY = 24*ONE_HOUR - INVALID_DOMAINS = ['youtube.com', 'bloomberg.com', 'wsj.com'] -MAX_AGE_IN_DAYS = 3*ONE_DAY substacks = {} for key, value in settings.SUBSTACK.items(): @@ -128,7 +124,7 @@ def update_story(story, is_manual=False): logging.info('Story not ready yet') return False - if story['date'] and not is_manual and story['date'] + MAX_AGE_IN_DAYS < time.time(): + if story['date'] and not is_manual and story['date'] + settings.MAX_STORY_AGE < time.time(): logging.info('Story too old, removing') return False