From a449b88689b0bd13b4e8822d9ac9a11e1d27f19a Mon Sep 17 00:00:00 2001 From: Alexander Kozlovsky Date: Tue, 28 Sep 2021 19:36:26 +0200 Subject: [PATCH] Call base run() method of RestfulComponent --- .../bandwidth_accounting/bandwidth_accounting_component.py | 2 +- .../components/gigachannel/gigachannel_component.py | 2 +- .../gigachannel_manager/gigachannel_manager_component.py | 2 +- src/tribler-core/tribler_core/components/ipv8.py | 2 +- src/tribler-core/tribler_core/components/libtorrent.py | 2 +- .../components/metadata_store/metadata_store_component.py | 2 +- src/tribler-core/tribler_core/components/resource_monitor.py | 2 +- src/tribler-core/tribler_core/components/restapi.py | 3 +++ src/tribler-core/tribler_core/components/torrent_checker.py | 2 +- src/tribler-core/tribler_core/components/tunnels.py | 2 +- src/tribler-core/tribler_core/components/upgrade.py | 2 +- src/tribler-core/tribler_core/components/watch_folder.py | 2 +- 12 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py b/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py index b80ea33cab4..3447e4e51af 100644 --- a/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py +++ b/src/tribler-core/tribler_core/components/bandwidth_accounting/bandwidth_accounting_component.py @@ -23,7 +23,7 @@ class BandwidthAccountingComponent(RestfulComponent): _ipv8: IPv8 async def run(self): - await self.get_component(ReporterComponent) + await super().run() await self.get_component(UpgradeComponent) config = self.session.config diff --git a/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py b/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py index 0feed671914..f808845b1dd 100644 --- a/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py +++ b/src/tribler-core/tribler_core/components/gigachannel/gigachannel_component.py @@ -21,6 +21,7 @@ class GigaChannelComponent(RestfulComponent): _ipv8: IPv8 async def run(self): + await super().run() await self.get_component(ReporterComponent) config = self.session.config @@ -52,7 +53,6 @@ async def run(self): await self.init_endpoints(['remote_query', 'channels', 'collections'], [('gigachannel_community', community)]) - async def shutdown(self): await super().shutdown() if self._ipv8: diff --git a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py b/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py index aa7f6c42612..846d897bbd2 100644 --- a/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py +++ b/src/tribler-core/tribler_core/components/gigachannel_manager/gigachannel_manager_component.py @@ -11,7 +11,7 @@ class GigachannelManagerComponent(RestfulComponent): gigachannel_manager: GigaChannelManager async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config notifier = self.session.notifier diff --git a/src/tribler-core/tribler_core/components/ipv8.py b/src/tribler-core/tribler_core/components/ipv8.py index f654f30616c..cdee23aed6f 100644 --- a/src/tribler-core/tribler_core/components/ipv8.py +++ b/src/tribler-core/tribler_core/components/ipv8.py @@ -31,7 +31,7 @@ class Ipv8Component(RestfulComponent): _peer_discovery_community: Optional[DiscoveryCommunity] = None async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config diff --git a/src/tribler-core/tribler_core/components/libtorrent.py b/src/tribler-core/tribler_core/components/libtorrent.py index 0b43a6e21d4..91937930ccf 100644 --- a/src/tribler-core/tribler_core/components/libtorrent.py +++ b/src/tribler-core/tribler_core/components/libtorrent.py @@ -14,7 +14,7 @@ class LibtorrentComponent(RestfulComponent): download_manager: DownloadManager async def run(self): - await self.get_component(ReporterComponent) + await super().run() await self.get_component(UpgradeComponent) socks_servers_component = await self.require_component(SocksServersComponent) master_key_component = await self.require_component(MasterKeyComponent) diff --git a/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py b/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py index f6cb50479b5..35e34ff8dd7 100644 --- a/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py +++ b/src/tribler-core/tribler_core/components/metadata_store/metadata_store_component.py @@ -14,7 +14,7 @@ class MetadataStoreComponent(RestfulComponent): mds: MetadataStore async def run(self): - await self.get_component(ReporterComponent) + await super().run() await self.get_component(UpgradeComponent) config = self.session.config diff --git a/src/tribler-core/tribler_core/components/resource_monitor.py b/src/tribler-core/tribler_core/components/resource_monitor.py index 9c17e9b10a3..b26b34b5478 100644 --- a/src/tribler-core/tribler_core/components/resource_monitor.py +++ b/src/tribler-core/tribler_core/components/resource_monitor.py @@ -9,7 +9,7 @@ class ResourceMonitorComponent(RestfulComponent): resource_monitor: CoreResourceMonitor async def run(self): - await self.get_component(ReporterComponent) + await super().run() await self.get_component(UpgradeComponent) config = self.session.config diff --git a/src/tribler-core/tribler_core/components/restapi.py b/src/tribler-core/tribler_core/components/restapi.py index f5d7000d4ba..540af82b050 100644 --- a/src/tribler-core/tribler_core/components/restapi.py +++ b/src/tribler-core/tribler_core/components/restapi.py @@ -47,6 +47,9 @@ async def init_ipv8_endpoints(self, ipv8, endpoints): if path in path_set: endpoint.initialize(ipv8) + async def run(self): + await self.get_component(ReporterComponent) + async def shutdown(self): rest_component = await self.get_component(RESTComponent) if not rest_component: diff --git a/src/tribler-core/tribler_core/components/torrent_checker.py b/src/tribler-core/tribler_core/components/torrent_checker.py index 29218069ed4..7562df98083 100644 --- a/src/tribler-core/tribler_core/components/torrent_checker.py +++ b/src/tribler-core/tribler_core/components/torrent_checker.py @@ -15,7 +15,7 @@ class TorrentCheckerComponent(RestfulComponent): torrent_checker: TorrentChecker async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config diff --git a/src/tribler-core/tribler_core/components/tunnels.py b/src/tribler-core/tribler_core/components/tunnels.py index 0c32f4f53b6..ca8e1fe4873 100644 --- a/src/tribler-core/tribler_core/components/tunnels.py +++ b/src/tribler-core/tribler_core/components/tunnels.py @@ -20,7 +20,7 @@ class TunnelsComponent(RestfulComponent): _ipv8: IPv8 async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config ipv8_component = await self.require_component(Ipv8Component) diff --git a/src/tribler-core/tribler_core/components/upgrade.py b/src/tribler-core/tribler_core/components/upgrade.py index 11f8c81e5af..b43d5b885c2 100644 --- a/src/tribler-core/tribler_core/components/upgrade.py +++ b/src/tribler-core/tribler_core/components/upgrade.py @@ -11,7 +11,7 @@ class UpgradeComponent(RestfulComponent): upgrader: TriblerUpgrader async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config notifier = self.session.notifier master_key_component = await self.require_component(MasterKeyComponent) diff --git a/src/tribler-core/tribler_core/components/watch_folder.py b/src/tribler-core/tribler_core/components/watch_folder.py index b33f4892a15..71a6f4b1275 100644 --- a/src/tribler-core/tribler_core/components/watch_folder.py +++ b/src/tribler-core/tribler_core/components/watch_folder.py @@ -11,7 +11,7 @@ class WatchFolderComponent(RestfulComponent): watch_folder: WatchFolder async def run(self): - await self.get_component(ReporterComponent) + await super().run() config = self.session.config notifier = self.session.notifier libtorrent_component = await self.require_component(LibtorrentComponent)