Skip to content

Commit

Permalink
fix: 订阅实例属性is_latest为False导致巡检未执行 (closed TencentBlueKing#2189)
Browse files Browse the repository at this point in the history
  • Loading branch information
Huayeaaa committed Apr 30, 2024
1 parent 1210116 commit 3b6ffb2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apps/backend/subscription/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3b6ffb2

Please sign in to comment.