Skip to content

Commit

Permalink
Call base run() method of RestfulComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Sep 28, 2021
1 parent e20030f commit a449b88
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/ipv8.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/libtorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/tribler-core/tribler_core/components/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/tunnels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/tribler-core/tribler_core/components/watch_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a449b88

Please sign in to comment.