crawler: separate CacheHander and actual caching

Default cache is now just an in-memory {}
This commit is contained in:
2017-11-04 12:41:56 +01:00
parent 523b250907
commit 194465544a
2 changed files with 29 additions and 39 deletions

View File

@@ -483,7 +483,7 @@ def process(url, cache=None, options=None):
options = Options(options)
if cache:
crawler.sqlite_default = cache
crawler.default_cache = crawler.SQLiteCache(cache)
rss = FeedFetch(url, options)
rss = FeedGather(rss, url, options)
@@ -544,7 +544,7 @@ def cgi_app(environ, start_response):
else:
headers['content-type'] = 'text/xml'
crawler.sqlite_default = os.path.join(os.getcwd(), 'morss-cache.db')
crawler.default_cache = crawler.SQLiteCache(os.path.join(os.getcwd(), 'morss-cache.db'))
# get the work done
rss = FeedFetch(url, options)
@@ -618,7 +618,7 @@ def cli_app():
global DEBUG
DEBUG = options.debug
crawler.sqlite_default = os.path.expanduser('~/.cache/morss-cache.db')
crawler.default_cache = crawler.SQLiteCache(os.path.expanduser('~/.cache/morss-cache.db'))
rss = FeedFetch(url, options)
rss = FeedGather(rss, url, options)