From ca954904123064b5b115ed8308558b73e2003613 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Fri, 18 Aug 2023 15:53:30 +0200 Subject: [PATCH] Added timeout parameter to requests.get in the rss plugin. --- platypush/plugins/rss/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/rss/__init__.py b/platypush/plugins/rss/__init__.py index f27d704cf..becb09832 100644 --- a/platypush/plugins/rss/__init__.py +++ b/platypush/plugins/rss/__init__.py @@ -118,7 +118,7 @@ class RssPlugin(RunnablePlugin): import feedparser feed = feedparser.parse( - requests.get(url, headers={'User-Agent': self.user_agent}).text + requests.get(url, headers={'User-Agent': self.user_agent}, timeout=20).text, ) return RssFeedEntrySchema().dump( sorted( @@ -331,7 +331,7 @@ class RssPlugin(RunnablePlugin): worker.start() self.logger.info( - f'Initialized RSS plugin with {len(self.subscriptions)} subscriptions' + 'Initialized RSS plugin with %d subscriptions', len(self.subscriptions) ) while not self.should_stop():