fix: scope transactional locks to primary records
This commit is contained in:
@@ -146,7 +146,7 @@ def start_ticket_knowledge_distillation(
|
||||
"""从可信解决结果启动幂等蒸馏运行,并冻结工单输入快照。"""
|
||||
|
||||
ticket = (
|
||||
Ticket.objects.select_for_update()
|
||||
Ticket.objects.select_for_update(of=("self",))
|
||||
.select_related("category", "resolution")
|
||||
.get(id=ticket.id)
|
||||
)
|
||||
@@ -255,7 +255,7 @@ def process_knowledge_distillation_result(
|
||||
if run.definition.code != KNOWLEDGE_DISTILLATION_AGENT_CODE or run.status != "succeeded":
|
||||
return None
|
||||
distillation = (
|
||||
TicketKnowledgeDistillation.objects.select_for_update()
|
||||
TicketKnowledgeDistillation.objects.select_for_update(of=("self",))
|
||||
.select_related("ticket__category", "ticket__resolution", "run__created_by")
|
||||
.get(run=run)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user