Only run the uncompressed size backfill for images that have a defined size > 0, but no uncompressed size

This commit is contained in:
Joseph Schorr 2014-11-10 19:41:58 -05:00
parent 611bc895e1
commit 3c990072fd

View file

@ -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()))