|
@@ -6,7 +6,6 @@ import com.css.simulation.resource.scheduler.configuration.feign.VideoFeignClien
|
|
|
import com.css.simulation.resource.scheduler.configuration.kubernetes.KubernetesConfiguration;
|
|
|
import com.css.simulation.resource.scheduler.entity.*;
|
|
|
import com.css.simulation.resource.scheduler.mapper.*;
|
|
|
-import com.css.simulation.resource.scheduler.resource.TaskLock;
|
|
|
import com.css.simulation.resource.scheduler.util.*;
|
|
|
import com.fasterxml.jackson.databind.JsonNode;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
@@ -83,8 +82,6 @@ public class TaskManager {
|
|
|
@Resource
|
|
|
private SqlSessionFactory sqlSessionFactory;
|
|
|
@Resource
|
|
|
- private TaskLock taskLock;
|
|
|
- @Resource
|
|
|
private KubernetesConfiguration kubernetesConfiguration;
|
|
|
@Resource
|
|
|
private ApiClient apiClient;
|
|
@@ -181,7 +178,7 @@ public class TaskManager {
|
|
|
* @param userId 项目创建用户的 id
|
|
|
*/
|
|
|
@SneakyThrows
|
|
|
- public void score(String userId, String projectId, String projectType, ClientSession session) {
|
|
|
+ public void score(String userId, String projectId, String projectType) {
|
|
|
// -------------------------------- 打分 --------------------------------
|
|
|
ProjectEntity projectEntity = null;
|
|
|
if (DictConstants.PROJECT_TYPE_MANUAL.equals(projectType)) {
|
|
@@ -189,11 +186,15 @@ public class TaskManager {
|
|
|
} else if (DictConstants.PROJECT_TYPE_AUTO_SUB.equals(projectType)) {
|
|
|
projectEntity = autoSubProjectMapper.selectById(projectId);
|
|
|
}
|
|
|
+ if (projectEntity == null) {
|
|
|
+ log.error("不存在项目 {}" + projectId);
|
|
|
+ return;
|
|
|
+ }
|
|
|
String packageId = projectEntity.getScenePackageId(); // 场景测试包 id,指标的rootId
|
|
|
TimeUnit.SECONDS.sleep(10); // 先等一下数据库更新
|
|
|
List<TaskEntity> taskList = taskMapper.selectTaskListByProjectId(projectId); // 所有任务信息
|
|
|
if (CollectionUtil.isEmpty(taskList)) {
|
|
|
- log.error("项目 " + projectId + " 下没有查询到任务!");
|
|
|
+ log.error("项目 {} 下没有查询到任务!", projectId);
|
|
|
return;
|
|
|
}
|
|
|
indexMapper.deleteFirstByProjectId(projectId);
|