From d8a34427ecd6900d66ed178f22ea7f6f6dbd8019 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Tue, 24 Feb 2015 17:17:55 -0500 Subject: [PATCH] Try to get around the tag deadlock by using a select for update. --- data/model/legacy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/model/legacy.py b/data/model/legacy.py index 94f799992..85b533053 100644 --- a/data/model/legacy.py +++ b/data/model/legacy.py @@ -1803,7 +1803,7 @@ def create_or_update_tag(namespace_name, repository_name, tag_name, query = _tag_alive(RepositoryTag .select() .where(RepositoryTag.repository == repo, RepositoryTag.name == tag_name)) - tag = query.get() + tag = db_for_update(query).get() tag.lifetime_end_ts = now_ts tag.save() except RepositoryTag.DoesNotExist: