fix: 性能测试消息发送失败

This commit is contained in:
wenyann 2020-11-05 14:54:39 +08:00
parent 9aeed6b027
commit e54bd0dc14
1 changed files with 19 additions and 20 deletions

View File

@ -47,10 +47,9 @@ public class PerformanceNoticeTask {
}
public void registerNoticeTask(LoadTestReportWithBLOBs loadTestReport) {
executorService.submit(() -> {
while (isRunning) {
int count = 20;
while (count-- > 0) {
LoadTestReportWithBLOBs loadTestReportFromDatabase = loadTestReportMapper.selectByPrimaryKey(loadTestReport.getId());
if (StringUtils.equals(loadTestReportFromDatabase.getStatus(), PerformanceTestStatus.Completed.name())) {
isRunning = false;
sendSuccessNotice(loadTestReportFromDatabase);
@ -61,13 +60,13 @@ public class PerformanceNoticeTask {
sendFailNotice(loadTestReportFromDatabase);
return;
}
count--;
try {
Thread.sleep(1000 * 60);// 每分钟检查 loadtest 的状态
Thread.sleep(1000 * 4L);// 每分钟检查 loadtest 的状态
} catch (InterruptedException e) {
LogUtil.error(e);
}
}
});
}
public void sendSuccessNotice(LoadTestReportWithBLOBs loadTestReport) {