forked from platypush/platypush
[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.
This commit is contained in:
parent
897f3a6f47
commit
76b86aec0e
1 changed files with 3 additions and 1 deletions
|
@ -59,8 +59,9 @@ class RssPlugin(RunnablePlugin):
|
||||||
self._feed_workers = []
|
self._feed_workers = []
|
||||||
self._latest_entries = []
|
self._latest_entries = []
|
||||||
|
|
||||||
self.subscriptions = list(self._parse_subscriptions(subscriptions or []))
|
|
||||||
self._latest_timestamps = {}
|
self._latest_timestamps = {}
|
||||||
|
self._subscriptions = subscriptions
|
||||||
|
self.subscriptions = []
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _get_feed_latest_timestamp_varname(url: str) -> str:
|
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()
|
return ElementTree.tostring(root, encoding='utf-8', method='xml').decode()
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
|
self.subscriptions = list(self._parse_subscriptions(self._subscriptions or []))
|
||||||
self._latest_timestamps = self._get_latest_timestamps()
|
self._latest_timestamps = self._get_latest_timestamps()
|
||||||
self._feed_workers = [
|
self._feed_workers = [
|
||||||
threading.Thread(target=self._feed_worker, args=(q,))
|
threading.Thread(target=self._feed_worker, args=(q,))
|
||||||
|
|
Loading…
Reference in a new issue