Switch back to the read-then-write tag deletion code
We changed to this originally to avoid locks
This commit is contained in:
parent
70de107268
commit
ba7686af99
1 changed files with 11 additions and 6 deletions
|
@ -100,11 +100,16 @@ def delete_tag(namespace_name, repository_name, tag_name):
|
|||
def garbage_collect_tags(repo):
|
||||
expired_time = get_epoch_timestamp() - repo.namespace_user.removed_tag_expiration_s
|
||||
|
||||
(RepositoryTag
|
||||
.delete()
|
||||
tags_to_delete = list(RepositoryTag
|
||||
.select(RepositoryTag.id)
|
||||
.where(RepositoryTag.repository == repo,
|
||||
~(RepositoryTag.lifetime_end_ts >> None),
|
||||
(RepositoryTag.lifetime_end_ts <= expired_time))
|
||||
.order_by(RepositoryTag.id))
|
||||
if len(tags_to_delete) > 0:
|
||||
(RepositoryTag
|
||||
.delete()
|
||||
.where(RepositoryTag.id << tags_to_delete)
|
||||
.execute())
|
||||
|
||||
|
||||
|
|
Reference in a new issue