Fix handling of aggregate size in V2

Fixes #931
This commit is contained in:
Joseph Schorr 2015-11-20 11:12:34 -05:00
parent aa1911fe15
commit f4266d08d2
2 changed files with 34 additions and 21 deletions

View file

@ -229,7 +229,7 @@ def lookup_repo_storages_by_content_checksum(repo, checksums):
for counter, checksum in enumerate(set(checksums)):
query_alias = 'q{0}'.format(counter)
candidate_subq = (ImageStorage
.select(ImageStorage.id, ImageStorage.content_checksum)
.select(ImageStorage.id, ImageStorage.content_checksum, ImageStorage.image_size)
.join(Image)
.where(Image.repository == repo, ImageStorage.content_checksum == checksum)
.limit(1)