Merge pull request #3288 from quay/faster-gc

Change garbage collection queries to be far smaller by GCing per tag and per image
This commit is contained in:
Joseph Schorr 2018-11-07 14:35:38 -05:00 committed by GitHub
commit 3e63b08731
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 33 deletions

View file

@ -517,10 +517,7 @@ def _delete_tags(repo, query_modifier=None):
.execute())
logger.debug('Removed %s tags with %s manifests', num_deleted_tags, num_deleted_manifests)
ancestors = reduce(lambda r, l: r | l,
(set(tag.image.ancestor_id_list()) for tag in tags_to_delete))
direct_referenced = {tag.image.id for tag in tags_to_delete}
return ancestors | direct_referenced
return [tag.image for tag in tags_to_delete]
def _get_repo_tag_image(tag_name, include_storage, modifier):