Handle the common case of one chunk when calculating the uncompressed size

Reference #992
This commit is contained in:
Joseph Schorr 2015-11-30 14:25:01 -05:00
parent 1323da20e3
commit 54095eb5cb
6 changed files with 65 additions and 4 deletions

View file

@ -26,7 +26,7 @@ def get_repo_blob_by_digest(namespace, repo_name, blob_digest):
def store_blob_record_and_temp_link(namespace, repo_name, blob_digest, location_obj, byte_count,
link_expiration_s):
link_expiration_s, uncompressed_byte_count=None):
""" Store a record of the blob and temporarily link it to the specified repository.
"""
random_image_name = str(uuid4())
@ -35,6 +35,7 @@ def store_blob_record_and_temp_link(namespace, repo_name, blob_digest, location_
try:
storage = ImageStorage.get(content_checksum=blob_digest)
storage.image_size = byte_count
storage.uncompressed_size = uncompressed_byte_count
storage.save()
ImageStoragePlacement.get(storage=storage, location=location_obj)