Added timeout parameter to requests.get in the rss plugin.

This commit is contained in:
Fabio Manganiello 2023-08-18 15:53:30 +02:00
parent 5dd7345c0b
commit ca95490412
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -118,7 +118,7 @@ class RssPlugin(RunnablePlugin):
import feedparser import feedparser
feed = feedparser.parse( 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( return RssFeedEntrySchema().dump(
sorted( sorted(
@ -331,7 +331,7 @@ class RssPlugin(RunnablePlugin):
worker.start() worker.start()
self.logger.info( 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(): while not self.should_stop():