Try to get around the tag deadlock by using a select for update.
This commit is contained in:
parent
afe6be0daf
commit
d8a34427ec
1 changed files with 1 additions and 1 deletions
|
@ -1803,7 +1803,7 @@ def create_or_update_tag(namespace_name, repository_name, tag_name,
|
||||||
query = _tag_alive(RepositoryTag
|
query = _tag_alive(RepositoryTag
|
||||||
.select()
|
.select()
|
||||||
.where(RepositoryTag.repository == repo, RepositoryTag.name == tag_name))
|
.where(RepositoryTag.repository == repo, RepositoryTag.name == tag_name))
|
||||||
tag = query.get()
|
tag = db_for_update(query).get()
|
||||||
tag.lifetime_end_ts = now_ts
|
tag.lifetime_end_ts = now_ts
|
||||||
tag.save()
|
tag.save()
|
||||||
except RepositoryTag.DoesNotExist:
|
except RepositoryTag.DoesNotExist:
|
||||||
|
|
Reference in a new issue