From c8dab1cc9c8fac41f40b42ced904b8e0b38dd437 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Mon, 14 Jul 2025 13:08:26 +0530 Subject: [PATCH] [WEB-4484]chore: streamline issue saving process with advisory locks for sequence management (#7396) * chore: streamline issue saving process with advisory locks for sequence management * fix: update advisory lock usage in issue model for improved concurrency management --- apps/api/plane/db/models/issue.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/plane/db/models/issue.py b/apps/api/plane/db/models/issue.py index 28602dc71..f42a4d480 100644 --- a/apps/api/plane/db/models/issue.py +++ b/apps/api/plane/db/models/issue.py @@ -215,7 +215,8 @@ class Issue(ProjectBaseModel): with connection.cursor() as cursor: # Get an exclusive lock using the project ID as the lock key - cursor.execute("SELECT pg_advisory_xact_lock(%s)", [lock_key]) + cursor.execute("SELECT pg_advisory_lock(%s)", [lock_key]) + try: # Get the last sequence for the project last_sequence = IssueSequence.objects.filter(