move wait to where its needed on assembler
This commit is contained in:
parent
320aabbd70
commit
a49f479a5f
1 changed files with 3 additions and 3 deletions
|
@ -119,16 +119,16 @@ class StreamAssembler:
|
||||||
self.descriptor.sd_hash)
|
self.descriptor.sd_hash)
|
||||||
continue
|
continue
|
||||||
finally:
|
finally:
|
||||||
if save_tasks:
|
|
||||||
await asyncio.wait(save_tasks)
|
|
||||||
if written_blobs == len(self.descriptor.blobs) - 2:
|
if written_blobs == len(self.descriptor.blobs) - 2:
|
||||||
log.debug("finished decrypting and assembling stream")
|
log.debug("finished decrypting and assembling stream")
|
||||||
|
if save_tasks:
|
||||||
|
await asyncio.wait(save_tasks)
|
||||||
await self.after_finished()
|
await self.after_finished()
|
||||||
self.stream_finished_event.set()
|
self.stream_finished_event.set()
|
||||||
else:
|
else:
|
||||||
log.debug("stream decryption and assembly did not finish (%i/%i blobs are done)", written_blobs or 0,
|
log.debug("stream decryption and assembly did not finish (%i/%i blobs are done)", written_blobs or 0,
|
||||||
len(self.descriptor.blobs) - 2)
|
len(self.descriptor.blobs) - 2)
|
||||||
if self.stream_handle is not None and self.output_path is not None:
|
if self.output_path and os.path.isfile(self.output_path):
|
||||||
log.debug("erasing incomplete file assembly: %s", self.output_path)
|
log.debug("erasing incomplete file assembly: %s", self.output_path)
|
||||||
os.unlink(self.output_path)
|
os.unlink(self.output_path)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue