Skip to content

Commit

Permalink
fix torrent component
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Aug 31, 2022
1 parent 3bb4750 commit 3ab3e38
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lbry/extras/daemon/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@ async def start(self):
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(
Expand All @@ -369,7 +365,8 @@ async def start(self):
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
)
Expand Down Expand Up @@ -498,9 +495,8 @@ async def get_status(self):
}

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:
Expand Down

0 comments on commit 3ab3e38

Please sign in to comment.