[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
This commit is contained in:
Nikhil
2025-07-14 13:08:26 +05:30
committed by GitHub
parent 17c90a9d93
commit c8dab1cc9c

View File

@@ -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(