From ca1878008a81aa055ea055d2c782436cce14648f 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 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/backend/subscription/tasks.py b/apps/backend/subscription/tasks.py index 590bbf652..943032d2f 100644 --- a/apps/backend/subscription/tasks.py +++ b/apps/backend/subscription/tasks.py @@ -25,6 +25,7 @@ from apps.backend.subscription import tools from apps.backend.subscription.constants import TASK_HOST_LIMIT from apps.backend.subscription.errors import SubscriptionInstanceEmpty +from apps.backend.subscription.handler import SubscriptionTools from apps.backend.subscription.steps import StepFactory, agent from apps.core.gray.tools import GrayTools from apps.node_man import constants, models @@ -712,8 +713,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 + 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: