Skip to content

Commit

Permalink
feat: CC接口限频优化 (closed TencentBlueKing#2531)
Browse files Browse the repository at this point in the history
  • Loading branch information
ping15 committed Jan 7, 2025
1 parent dd18452 commit 85f4f27
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/backend/subscription/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ def find_host_biz_relations(bk_host_ids: List[int]) -> List[Dict]:
func=client_v2.cc.find_host_biz_relations,
params_list=param_list,
interval=constants.FIND_HOST_BIZ_RELATIONS_INTERVAL,
extend_result=True,
)

return host_biz_relations
Expand Down
22 changes: 22 additions & 0 deletions apps/backend/tests/subscription/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3327,6 +3327,28 @@ def list_service_instance_detail(cls, *args, **kwargs):
SERVICE_DETAIL["info"] = [x for x in SERVICE_DETAIL["info"] if x["id"] == 10]
return SERVICE_DETAIL

@classmethod
def list_service_instance(cls, *args, **kwargs):
return {
"count": 49,
"info": [
{
"bk_biz_id": 1,
"id": 10,
"name": "127.0.0.1_gse_agent",
"labels": None,
"service_template_id": 14,
"bk_host_id": 1,
"bk_module_id": 12,
"creator": "cc_system",
"modifier": "cc_system",
"create_time": "2019-07-09T13:06:54.384+08:00",
"last_time": "2019-07-09T13:06:54.384+08:00",
"bk_supplier_account": "0",
}
],
}

@classmethod
def find_host_by_topo(cls, *args, **kwargs):
return {"count": 4, "info": LIST_BIZ_HOSTS_WITHOUT_INFO}
Expand Down

0 comments on commit 85f4f27

Please sign in to comment.