From 7d0d416610ffb51692e78bf9d04d2d6dce78aa86 Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 12 May 2020 21:10:31 +0200 Subject: [PATCH] morss: cache articles for 24hrs Also make it possible to refetch articles, regardless of cache --- morss/morss.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/morss/morss.py b/morss/morss.py index 2d2452b..2f00f3e 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -243,10 +243,17 @@ def ItemFill(item, options, feedurl='/', fast=False): # download delay = -1 - if fast: - # super-fast mode + if fast or options.fast: + # force cache, don't fetch delay = -2 + elif options.force: + # force refresh + delay = 0 + + else: + delay = 24*60*60 # 24h + try: req = crawler.adv_get(url=link, delay=delay, timeout=TIMEOUT)