- Add a log entry for repo verb handling and make the container usage calculation take it into account

- Move all the repo push/pull/verb logging into a central track_and_log method
- Readd images accidentally deleted in the last CL
- Make the uncompressed size migration script better handle exceptions
This commit is contained in:
Joseph Schorr 2014-10-29 15:42:44 -04:00
parent c65031eea5
commit c1398c6d2b
18 changed files with 216 additions and 85 deletions

View file

@ -25,6 +25,8 @@ def backfill_sizes_from_data():
ch.setFormatter(formatter)
logger.addHandler(ch)
encountered = set()
while True:
# Load the record from the DB.
batch_ids = list(ImageStorage
@ -33,12 +35,15 @@ def backfill_sizes_from_data():
ImageStorage.uploading == False)
.limit(100)
.order_by(db_random_func()))
batch_ids = set(batch_ids) - encountered
if len(batch_ids) == 0:
# We're done!
return
for record in batch_ids:
uuid = record.uuid
encountered.add(uuid)
try:
with_locs = model.get_storage_by_uuid(uuid)
@ -76,6 +81,8 @@ def backfill_sizes_from_data():
except model.InvalidImageException:
logger.warning('Storage with uuid no longer exists: %s', uuid)
except IOError:
logger.warning('IOError on %s', uuid)
except MemoryError:
logger.warning('MemoryError on %s', uuid)