Skip to content

Commit

Permalink
Merge pull request #1413 from benero/minor_pipeline
Browse files Browse the repository at this point in the history
minor: 还原 pipeline 实现,F更新不影响数据准确性 --story=129838029
  • Loading branch information
benero authored Sep 27, 2024
2 parents 2827bde + b00031c commit 42e8682
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pipeline/engine/models/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,9 @@ def destroy_and_wake_up_parent(self, destination_id):
data_service.set_object(self._context_key(), self.top_pipeline.context)
data_service.set_object(self._data_key(), self.top_pipeline.data)

with transaction.atomic():
parent = self.__class__.objects.select_for_update().get(id=self.parent_id)
parent.ack_num += 1
parent.save()

self.__class__.objects.filter(id=self.parent_id).update(
ack_num=models.F("ack_num") + 1
)
can_wake_up = False

with transaction.atomic():
Expand Down

0 comments on commit 42e8682

Please sign in to comment.