Remove dependent signatures before removing image storages

This commit is contained in:
Jake Moshenko 2016-01-19 14:50:31 -05:00
parent 7d0be20842
commit 1b392dcb9a

View file

@ -75,6 +75,12 @@ def garbage_collect_storage(storage_id_whitelist):
.execute())
logger.debug('Removed %s torrent info records', torrents_removed)
signatures_removed = (ImageStorageSignature
.delete()
.where(ImageStorageSignature.storage << orphaned_storages)
.execute())
logger.debug('Removed %s image storage signatures', signatures_removed)
storages_removed = (ImageStorage
.delete()
.where(ImageStorage.id << orphaned_storages)