未验证 提交 7bfd60be 编写于 作者: qd_lm's avatar qd_lm 提交者: GitHub

资源排行去掉内置租户 (#544)

Co-authored-by: Nalickliming <alickliming@didi.global.com>
上级 b7284ada
......@@ -602,7 +602,7 @@ func tenantResourcesCountRank(c *gin.Context) {
resMap := make(map[string]int, 50)
for _, res := range ress {
tenant := res.Tenant
if tenant != "" {
if tenant != "" && tenant != "inner" {
if _, ok := resMap[tenant]; !ok {
resMap[tenant] = 0
}
......@@ -650,9 +650,17 @@ func projectResourcesCountRank(c *gin.Context) {
}
// 获取全部project
projectNodes, err := models.NodeGets("cate=?", "project")
projectAllNodes, err := models.NodeGets("cate=?", "project")
dangerous(err)
var projectNodes []models.Node
for _, p := range projectAllNodes {
tenant := p.Tenant()
if tenant != "inner" {
projectNodes = append(projectNodes, p)
}
}
projectNodesLen := len(projectNodes)
workerNum := 50
if projectNodesLen < workerNum {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册