perf: sorted team by memory (#1571)

This commit is contained in:
张启航 2023-02-27 19:36:49 +08:00 committed by GitHub
parent 0b4618a75f
commit d950870433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,12 @@ func (t *TenantAction) BindTenantsResource(source []*dbmodel.Tenants) api_model.
}
list.Add(item)
}
sort.Sort(list)
sort.SliceStable(list, func(i, j int) bool {
if list[i].MemoryRequest > list[j].MemoryRequest {
return true
}
return false
})
return list
}