Skip to content

Commit a1079af

Browse files
author
maniarathi
committed
Read whole file for checksumming instead of part of file.
1 parent 633b3a0 commit a1079af

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

hca/upload/lib/client_side_checksum_handler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ def compute(self):
4747
_multipart_chunksize = get_s3_multipart_chunk_size(_file_size)
4848
with ChecksummingSink(_multipart_chunksize, hash_functions=self._checksums) as sink:
4949
with open(self._filename, 'rb') as _file_object:
50-
sink.write(_file_object.read(_multipart_chunksize))
50+
data = _file_object.read(_multipart_chunksize)
51+
while data:
52+
sink.write(data)
53+
data = _file_object.read(_multipart_chunksize)
5154
checksums = sink.get_checksums()
5255
print("Checksumming took %.2f milliseconds to compute" % ((time.time() - start_time) * 1000))
5356
return checksums

0 commit comments

Comments
 (0)