Skip to content

Commit

Permalink
make sure the downloader always stops gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
shyba committed Nov 3, 2021
1 parent e1112db commit c0b8bdc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lbry/stream/background_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ async def download_blobs(self, sd_hash):
downloader = StreamDownloader(asyncio.get_running_loop(), self.conf, self.blob_manager, sd_hash)
try:
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:
return
for blob_info in downloader.descriptor.blobs[:-1]:
await downloader.download_stream_blob(blob_info)
# 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)
finally:
downloader.stop()

0 comments on commit c0b8bdc

Please sign in to comment.