From 8a033d58df516883f250b81b9a94b867152f7e49 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Thu, 18 Aug 2022 19:29:51 -0300 Subject: [PATCH] fix torrent component --- lbry/extras/daemon/components.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lbry/extras/daemon/components.py b/lbry/extras/daemon/components.py index 116fb3607..33deccee9 100644 --- a/lbry/extras/daemon/components.py +++ b/lbry/extras/daemon/components.py @@ -357,10 +357,6 @@ class FileManagerComponent(Component): wallet = self.component_manager.get_component(WALLET_COMPONENT) node = self.component_manager.get_component(DHT_COMPONENT) \ if self.component_manager.has_component(DHT_COMPONENT) else None - try: - torrent = self.component_manager.get_component(LIBTORRENT_COMPONENT) if TorrentSession else None - except NameError: - torrent = None log.info('Starting the file manager') loop = asyncio.get_event_loop() self.file_manager = FileManager( @@ -369,7 +365,8 @@ class FileManagerComponent(Component): self.file_manager.source_managers['stream'] = StreamManager( loop, self.conf, blob_manager, wallet, storage, node, ) - if TorrentSession and LIBTORRENT_COMPONENT not in self.conf.components_to_skip: + if self.component_manager.has_component(LIBTORRENT_COMPONENT): + torrent = self.component_manager.get_component(LIBTORRENT_COMPONENT) self.file_manager.source_managers['torrent'] = TorrentManager( loop, self.conf, torrent, storage, self.component_manager.analytics_manager ) @@ -498,9 +495,8 @@ class TorrentComponent(Component): } async def start(self): - if TorrentSession: - self.torrent_session = TorrentSession(asyncio.get_event_loop(), None) - await self.torrent_session.bind() # TODO: specify host/port + self.torrent_session = TorrentSession(asyncio.get_event_loop(), None) + await self.torrent_session.bind() # TODO: specify host/port async def stop(self): if self.torrent_session: