refactor(测试计划): 定时清理无效队列数据
This commit is contained in:
parent
4fc8c840a7
commit
32f2368c9c
|
@ -533,5 +533,9 @@ public class ApiExecutionQueueService {
|
||||||
|
|
||||||
ApiExecutionQueueDetailExample detailExample = new ApiExecutionQueueDetailExample();
|
ApiExecutionQueueDetailExample detailExample = new ApiExecutionQueueDetailExample();
|
||||||
executionQueueDetailMapper.deleteByExample(detailExample);
|
executionQueueDetailMapper.deleteByExample(detailExample);
|
||||||
|
|
||||||
|
extApiScenarioReportMapper.updateByRunning();
|
||||||
|
|
||||||
|
extApiDefinitionExecResultMapper.updateByRunning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,4 +53,6 @@ public interface ExtApiDefinitionExecResultMapper {
|
||||||
List<String> selectDistinctStatusByReportId(String reportId);
|
List<String> selectDistinctStatusByReportId(String reportId);
|
||||||
|
|
||||||
List<String> selectByProjectIdAndLessThanTime(@Param("projectId") String projectId, @Param("time") long time);
|
List<String> selectByProjectIdAndLessThanTime(@Param("projectId") String projectId, @Param("time") long time);
|
||||||
|
|
||||||
|
void updateByRunning();
|
||||||
}
|
}
|
||||||
|
|
|
@ -484,4 +484,8 @@
|
||||||
select id from api_definition_exec_result where project_id = #{projectId} and create_time < #{time}
|
select id from api_definition_exec_result where project_id = #{projectId} and create_time < #{time}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateByRunning" parameterType="java.util.List">
|
||||||
|
update api_definition_exec_result set `status`= "STOP" where `status` ="Running"
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -11,8 +11,7 @@
|
||||||
FROM
|
FROM
|
||||||
api_execution_queue
|
api_execution_queue
|
||||||
WHERE
|
WHERE
|
||||||
report_id != NULL
|
run_mode IN ( 'API_PLAN', 'JENKINS_SCENARIO_PLAN', 'SCHEDULE_SCENARIO_PLAN' )
|
||||||
AND run_mode IN ( 'API_PLAN', 'JENKINS_SCENARIO_PLAN', 'SCHEDULE_SCENARIO_PLAN' )
|
|
||||||
AND id NOT IN ( SELECT t1.queue_id FROM api_execution_queue_detail t1 )
|
AND id NOT IN ( SELECT t1.queue_id FROM api_execution_queue_detail t1 )
|
||||||
AND report_id NOT IN ( SELECT report_id FROM test_plan_execution_queue );
|
AND report_id NOT IN ( SELECT report_id FROM test_plan_execution_queue );
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -48,4 +48,6 @@ public interface ExtApiScenarioReportMapper {
|
||||||
List<ApiScenarioReport> findByProjectIds(@Param("request") TaskCenterRequest request);
|
List<ApiScenarioReport> findByProjectIds(@Param("request") TaskCenterRequest request);
|
||||||
|
|
||||||
List<String> selectByProjectIdAndLessThanTime(@Param("projectId") String projectId, @Param("time") long time);
|
List<String> selectByProjectIdAndLessThanTime(@Param("projectId") String projectId, @Param("time") long time);
|
||||||
|
|
||||||
|
void updateByRunning();
|
||||||
}
|
}
|
||||||
|
|
|
@ -468,4 +468,8 @@
|
||||||
select id from api_scenario_report where create_time < #{time} and project_id = #{projectId}
|
select id from api_scenario_report where create_time < #{time} and project_id = #{projectId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<update id="updateByRunning">
|
||||||
|
update api_scenario_report set `status`= "STOP" where `status` ="Running"
|
||||||
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
Loading…
Reference in New Issue