resume downloads if DHT disabled

This commit is contained in:
Victor Shyba 2019-02-13 19:57:12 -03:00 committed by Lex Berezhny
parent 21ca4f60f7
commit 37bb765a2e

View file

@ -156,10 +156,10 @@ class StreamManager:
log.info("Started stream manager with %i files", len(file_infos)) log.info("Started stream manager with %i files", len(file_infos))
async def resume(self): async def resume(self):
if not self.node: if self.node:
log.warning("no DHT node given, cannot resume downloads") await self.node.joined.wait()
return else:
await self.node.joined.wait() log.warning("no DHT node given, resuming downloads trusting that we can contact reflector")
t = [ t = [
stream.start_download(self.node) stream.start_download(self.node)
for stream in self.streams if stream.status == ManagedStream.STATUS_RUNNING for stream in self.streams if stream.status == ManagedStream.STATUS_RUNNING