Skip to content

Commit

Permalink
CLI is using a blocksize that is different than upload. Changing to m…
Browse files Browse the repository at this point in the history
…atch.
  • Loading branch information
maniarathi committed Jun 12, 2019
1 parent 20caac2 commit 4c86c95
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hca/upload/lib/client_side_checksum_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class ChecksumCalculator:
""" The ChecksumCalculator encapsulates calling various library functions based on the required checksum to
be calculated on a file."""

READ_BLOCKSIZE = 10 * 1024 * 1024 # Do I/O in 10MiB chunks.

def __init__(self, filename, checksums=CHECKSUM_NAMES):
self._filename = filename
self._checksums = checksums
Expand All @@ -49,7 +47,7 @@ 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(self.READ_BLOCKSIZE))
sink.write(_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 4c86c95

Please sign in to comment.