Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-4484]chore: streamline issue saving process with advisory locks for sequence management (#7396)

Nikhilc8dab1cc9c8f
diff --git a/apps/api/plane/db/models/issue.py b/apps/api/plane/db/models/issue.py
index 28602dc718..f42a4d4807 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(