resume streams on startup
This commit is contained in:
parent
11bb1cc7ee
commit
736a949cb5
1 changed files with 6 additions and 5 deletions
|
@ -142,11 +142,12 @@ class StreamManager:
|
||||||
log.warning("no DHT node given, cannot resume downloads")
|
log.warning("no DHT node given, cannot resume downloads")
|
||||||
return
|
return
|
||||||
await self.node.joined.wait()
|
await self.node.joined.wait()
|
||||||
resumed = 0
|
t = [
|
||||||
t = [self.start_stream(stream) for stream in self.streams if stream.status == ManagedStream.STATUS_RUNNING]
|
stream.start_download(self.node)
|
||||||
if resumed:
|
for stream in self.streams if stream.status == ManagedStream.STATUS_RUNNING
|
||||||
log.info("resuming %i downloads", t)
|
]
|
||||||
await asyncio.gather(*t, loop=self.loop)
|
if t:
|
||||||
|
log.info("resuming %i downloads", len(t))
|
||||||
|
|
||||||
async def reflect_streams(self):
|
async def reflect_streams(self):
|
||||||
while True:
|
while True:
|
||||||
|
|
Loading…
Reference in a new issue