Skip to content

Commit

Permalink
feat(mongodb): mongos自愈,mongo实例下架 TencentBlueKing#7010
Browse files Browse the repository at this point in the history
  • Loading branch information
yyhenryyy committed Oct 17, 2024
1 parent fa40597 commit a94b086
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dbm-ui/backend/ticket/builders/mongodb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from backend.ticket.builders.common.base import (
BaseOperateResourceParamBuilder,
MongoDBTicketFlowBuilderPatchMixin,
SkipToRepresentationMixin,
SkipToRepresentationMixin, fetch_cluster_ids,
)

MONGODB_SHARD_GROUP_COUNT = 3
Expand Down Expand Up @@ -127,7 +127,7 @@ def scatter_cluster_id_info(cls, infos):
@classmethod
def add_cluster_type_info(cls, infos):
"""给每个info加上集群类型"""
cluster_ids = [info["cluster_id"] for info in infos]
cluster_ids = fetch_cluster_ids(infos)
id__cluster = {cluster.id: cluster for cluster in Cluster.objects.filter(id__in=cluster_ids)}
for info in infos:
info["cluster_type"] = id__cluster[info["cluster_id"]].cluster_type
Expand All @@ -136,7 +136,7 @@ def add_cluster_type_info(cls, infos):
@classmethod
def add_cluster_info(cls, infos):
"""给每个info加上集群类型、版本信息、名称"""
cluster_ids = [info["cluster_id"] for info in infos]
cluster_ids = fetch_cluster_ids(infos)
id__cluster = {cluster.id: cluster for cluster in Cluster.objects.filter(id__in=cluster_ids)}
for info in infos:
info["cluster_type"] = id__cluster[info["cluster_id"]].cluster_type
Expand Down

0 comments on commit a94b086

Please sign in to comment.