fix deleting a file mid download

This commit is contained in:
Jack Robison 2019-01-31 17:34:48 -05:00
parent 957d0290df
commit df86937f4e
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -98,10 +98,14 @@ class StreamAssembler:
blob = await self.get_blob(blob_info.blob_hash, blob_info.length) blob = await self.get_blob(blob_info.blob_hash, blob_info.length)
await self._decrypt_blob(blob, blob_info, self.descriptor.key) await self._decrypt_blob(blob, blob_info, self.descriptor.key)
break break
except (ValueError, IOError, OSError) as err: except FileNotFoundError:
log.error("failed to decrypt blob %s for stream %s - %s", blob_info.blob_hash, log.debug("stream assembler stopped")
self.descriptor.sd_hash, str(err)) return
except (ValueError, IOError, OSError):
log.warning("failed to decrypt blob %s for stream %s", blob_info.blob_hash,
self.descriptor.sd_hash)
continue continue
if not self.wrote_bytes_event.is_set(): if not self.wrote_bytes_event.is_set():
self.wrote_bytes_event.set() self.wrote_bytes_event.set()
self.stream_finished_event.set() self.stream_finished_event.set()