From 3c990072fd609dc8ced7583bb39330ead1add8d7 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 10 Nov 2014 19:41:58 -0500 Subject: [PATCH] Only run the uncompressed size backfill for images that have a defined size > 0, but no uncompressed size --- util/uncompressedsize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/uncompressedsize.py b/util/uncompressedsize.py index 6e9e44deb..5a6f16602 100644 --- a/util/uncompressedsize.py +++ b/util/uncompressedsize.py @@ -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()))