Only run the uncompressed size backfill for images that have a defined size > 0, but no uncompressed size
This commit is contained in:
parent
611bc895e1
commit
3c990072fd
1 changed files with 2 additions and 0 deletions
|
@ -29,6 +29,7 @@ def backfill_sizes_from_data():
|
|||
has_images = bool(list(ImageStorage
|
||||
.select(ImageStorage.uuid)
|
||||
.where(ImageStorage.uncompressed_size >> None,
|
||||
ImageStorage.image_size > 0,
|
||||
ImageStorage.uploading == False)
|
||||
.limit(1)))
|
||||
|
||||
|
@ -43,6 +44,7 @@ def backfill_sizes_from_data():
|
|||
batch_ids = list(ImageStorage
|
||||
.select(ImageStorage.uuid)
|
||||
.where(ImageStorage.uncompressed_size >> None,
|
||||
ImageStorage.image_size > 0,
|
||||
ImageStorage.uploading == False)
|
||||
.limit(100)
|
||||
.order_by(db_random_func()))
|
||||
|
|
Reference in a new issue