perf(llm): 优化 FineTuningTaskService.listFineTuningTaskRespVOS 方法

- 在获取服务器名称列表之前,增加了对 GPU 类型 ID 列表的空值检查
- 如果 GPU 类型 ID 列表为空,则直接返回空的结果列表,避免不必要的数据库查询
This commit is contained in:
Liuyang 2025-02-25 14:35:45 +08:00
parent 36802463b8
commit 1fed32672e

View File

@ -263,6 +263,10 @@ public class FineTuningTaskServiceImpl implements FineTuningTaskService {
.map(FineTuningTaskDO::getGpuType)
.filter(Objects::nonNull)
.collect(Collectors.toList());
if (CollectionUtils.isEmpty(gpuTypeIds)){
return respVOS;
}
List<ServerNameDO> serverNameDOS = serverNameMapper.selectList(new LambdaQueryWrapper<ServerNameDO>()
.in(ServerNameDO::getId, gpuTypeIds));
Map<Long, ServerNameDO> longServerNameDOMap = cn.iocoder.yudao.framework.common.util.collection.CollectionUtils