remove limit.

This commit is contained in:
Jason Schwarzenberger 2020-11-09 17:54:50 +13:00
parent 7b8cbfc9b9
commit c1b7877f4b
2 changed files with 2 additions and 7 deletions

View File

@ -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):

View File

@ -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