Skip to content

Commit

Permalink
Read whole file for checksumming instead of part of file.
Browse files Browse the repository at this point in the history
  • Loading branch information
maniarathi committed Jun 12, 2019
1 parent 633b3a0 commit a1079af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hca/upload/lib/client_side_checksum_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ def compute(self):
_multipart_chunksize = get_s3_multipart_chunk_size(_file_size)
with ChecksummingSink(_multipart_chunksize, hash_functions=self._checksums) as sink:
with open(self._filename, 'rb') as _file_object:
sink.write(_file_object.read(_multipart_chunksize))
data = _file_object.read(_multipart_chunksize)
while data:
sink.write(data)
data = _file_object.read(_multipart_chunksize)
checksums = sink.get_checksums()
print("Checksumming took %.2f milliseconds to compute" % ((time.time() - start_time) * 1000))
return checksums

0 comments on commit a1079af

Please sign in to comment.