forked from LBRYCommunity/lbry-sdk
make sure the downloader always stops gracefully
This commit is contained in:
parent
b055c25156
commit
48bb84fc1e
1 changed files with 4 additions and 4 deletions
|
@ -14,9 +14,9 @@ class BackgroundDownloader:
|
||||||
downloader = StreamDownloader(asyncio.get_running_loop(), self.conf, self.blob_manager, sd_hash)
|
downloader = StreamDownloader(asyncio.get_running_loop(), self.conf, self.blob_manager, sd_hash)
|
||||||
try:
|
try:
|
||||||
await downloader.start(self.node, save_stream=False)
|
await downloader.start(self.node, save_stream=False)
|
||||||
|
for blob_info in downloader.descriptor.blobs[:-1]:
|
||||||
|
await downloader.download_stream_blob(blob_info)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return
|
return
|
||||||
for blob_info in downloader.descriptor.blobs[:-1]:
|
finally:
|
||||||
await downloader.download_stream_blob(blob_info)
|
downloader.stop()
|
||||||
# for now, announcing is unnecessary because the blobs we have were announced to us, se they will be queried
|
|
||||||
# await self.storage.set_announce(sd_hash, downloader.descriptor.blobs[0].blob_hash)
|
|
||||||
|
|
Loading…
Reference in a new issue