refactor(接口测试): 优化更新执行结果方法

This commit is contained in:
fit2-zhao 2022-05-06 18:37:12 +08:00 committed by fit2-zhao
parent eaa94d74b3
commit 4c54671510
2 changed files with 8 additions and 8 deletions

View File

@ -176,7 +176,7 @@
</select>
<update id="stopScenario">
update api_scenario_report set status ='STOP' where
update api_scenario_report set status ='STOP' where status in ("running","starting","waiting") and
project_id in
<foreach collection="request.projects" item="id" separator="," open="(" close=")">
#{id}
@ -185,7 +185,7 @@
<update id="stopApi">
update api_definition_exec_result set status ='STOP' where
update api_definition_exec_result set status ='STOP' where status in ("running","starting","waiting") and
project_id in
<foreach collection="request.projects" item="id" separator="," open="(" close=")">
#{id}

View File

@ -193,7 +193,6 @@ public class TaskService {
execThreadPoolExecutor.removeQueue(item.getId());
PoolExecBlockingQueueUtil.offer(item.getId());
}
}
LoggerUtil.info("结束API进行中的报告");
extTaskMapper.stopApi(taskCenterRequest);
// 清理队列并停止测试计划报告
@ -201,6 +200,7 @@ public class TaskService {
List<String> ids = results.stream().map(ApiDefinitionExecResult::getId).collect(Collectors.toList());
apiExecutionQueueService.stop(ids);
}
}
if (taskRequestMap.containsKey("SCENARIO")) {
List<ApiScenarioReport> reports = extApiScenarioReportMapper.findByProjectIds(taskCenterRequest);
LoggerUtil.info("查询到执行中的场景报告:" + reports.size());