From 76b86aec0e12bf4f605284ab3c43b783defc79c9 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 20 Oct 2024 03:24:37 +0200 Subject: [PATCH] [rss] Moved `_parse_subscriptions` call inside of `main`. Rather than the plugin constructor. This is to ensure that the application startup won't be have to wait for the feed parsing logic to complete. --- platypush/plugins/rss/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/rss/__init__.py b/platypush/plugins/rss/__init__.py index d8467ace79..b08ebd0327 100644 --- a/platypush/plugins/rss/__init__.py +++ b/platypush/plugins/rss/__init__.py @@ -59,8 +59,9 @@ class RssPlugin(RunnablePlugin): self._feed_workers = [] self._latest_entries = [] - self.subscriptions = list(self._parse_subscriptions(subscriptions or [])) self._latest_timestamps = {} + self._subscriptions = subscriptions + self.subscriptions = [] @staticmethod def _get_feed_latest_timestamp_varname(url: str) -> str: @@ -318,6 +319,7 @@ class RssPlugin(RunnablePlugin): return ElementTree.tostring(root, encoding='utf-8', method='xml').decode() def main(self): + self.subscriptions = list(self._parse_subscriptions(self._subscriptions or [])) self._latest_timestamps = self._get_latest_timestamps() self._feed_workers = [ threading.Thread(target=self._feed_worker, args=(q,))