From 1def8482330d1d8fd91ef8c4af9b72ae5142f1fe Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 8 Jul 2019 12:45:30 +0100 Subject: [PATCH] switch rss.py to use utils.http.request_many --- modules/rss.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/rss.py b/modules/rss.py index a91e4aaf..e8c45131 100644 --- a/modules/rss.py +++ b/modules/rss.py @@ -39,16 +39,10 @@ class Module(ModuleManager.BaseModule): hooks[url] = [] hooks[url].append((server, channel)) - for url, channels in hooks.items(): - try: - data = utils.http.request(url) - feed = feedparser.parse(data.data) - feed["feed"] or ValueError("Feed info empty") - except Exception as e: - self.log.warn("Failed to GET RSS for %s: %s", - [url, str(e)]) - continue + pages = utils.http.request_many(hooks.keys()) + for url, channels in hooks.items(): + feed = feedparser.parse(pages[url].data) feed_title = feed["feed"].get("title", None) entry_formatted = {}