Dont rise an exception in patchfile close()
This allows partial transfers, by overwriting the dest file with the tempfile even if the transfer was not completed
This commit is contained in:
parent
34df7f6bc8
commit
46e51811e8
@ -133,11 +133,9 @@ class PatchFile(StreamingJob):
|
|||||||
self.get_remaining_output()
|
self.get_remaining_output()
|
||||||
self.src_file.close()
|
self.src_file.close()
|
||||||
count = 100
|
count = 100
|
||||||
while not self.finished:
|
while not self.finished and count > 0:
|
||||||
self()
|
self()
|
||||||
count -= 1
|
count -= 1
|
||||||
if count == 0:
|
|
||||||
raise Exception('Patching file did not receive enough input')
|
|
||||||
self.dest_file.close()
|
self.dest_file.close()
|
||||||
if self.overwrite_src:
|
if self.overwrite_src:
|
||||||
os.replace(self.dest_file.name, self.src_file.name)
|
os.replace(self.dest_file.name, self.src_file.name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user