Load images and storage references in bulk during V1 synthesize
Currently, we perform multiple queries for each layer, making it much slower (especially cross-region) Fixes #413
This commit is contained in:
parent
78e8aefd45
commit
35c35d9913
4 changed files with 173 additions and 157 deletions
|
@ -232,5 +232,10 @@ def get_layer_path(storage_record):
|
|||
|
||||
return store.blob_path(storage_record.checksum)
|
||||
|
||||
|
||||
|
||||
def lookup_repo_storages_by_checksum(repo, checksums):
|
||||
""" Looks up repository storages (without placements) matching the given repository
|
||||
and checksum. """
|
||||
return (ImageStorage
|
||||
.select()
|
||||
.join(Image)
|
||||
.where(Image.repository == repo, ImageStorage.checksum << checksums))
|
||||
|
|
Reference in a new issue