Fix subquery on MySQL
This commit is contained in:
parent
44ff85d044
commit
fe8d006855
1 changed files with 2 additions and 1 deletions
|
@ -1459,7 +1459,8 @@ def set_image_size(docker_image_id, namespace_name, repository_name, image_size,
|
||||||
# total_size = image_size + parent_image.storage.aggregate_size
|
# total_size = image_size + parent_image.storage.aggregate_size
|
||||||
total_size = (ImageStorage.select(fn.Sum(ImageStorage.image_size))
|
total_size = (ImageStorage.select(fn.Sum(ImageStorage.image_size))
|
||||||
.join(Image)
|
.join(Image)
|
||||||
.where(Image.id << ancestors)) + image_size
|
.where(Image.id << ancestors)
|
||||||
|
.scalar()) + image_size
|
||||||
|
|
||||||
image.storage.aggregate_size = total_size
|
image.storage.aggregate_size = total_size
|
||||||
except Image.DoesNotExist:
|
except Image.DoesNotExist:
|
||||||
|
|
Reference in a new issue