From 3b6ffb2c160547edb15cb1ae6455eaedcc4e4dcd Mon Sep 17 00:00:00 2001 From: dcd <1151627903@qq.com> Date: Tue, 30 Apr 2024 18:59:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AE=A2=E9=98=85=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7is=5Flatest=E4=B8=BAFalse=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=E6=9C=AA=E6=89=A7=E8=A1=8C=20(closed=20#2189?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/subscription/tasks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/backend/subscription/tasks.py b/apps/backend/subscription/tasks.py index 590bbf652..aafc62b5a 100644 --- a/apps/backend/subscription/tasks.py +++ b/apps/backend/subscription/tasks.py @@ -22,7 +22,7 @@ from apps.backend.celery import app from apps.backend.components.collections.base import ActivityType -from apps.backend.subscription import tools +from apps.backend.subscription import handler, tools from apps.backend.subscription.constants import TASK_HOST_LIMIT from apps.backend.subscription.errors import SubscriptionInstanceEmpty from apps.backend.subscription.steps import StepFactory, agent @@ -712,8 +712,10 @@ def run_subscription_task_and_create_instance( not_exist_instance_id = set(instance_not_in_scope) - set(deleted_instance_info) if not_exist_instance_id: records = list( - models.SubscriptionInstanceRecord.objects.filter( - subscription_id=subscription.id, instance_id__in=not_exist_instance_id, is_latest=True + handler.SubscriptionTools.fetch_latest_record_ids_in_same_inst_id( + models.SubscriptionInstanceRecord.objects.filter( + subscription_id=subscription.id, instance_id__in=not_exist_instance_id + ) ) ) for record in records: