fix 性能测试定时任务

This commit is contained in:
chenjianxing 2020-06-29 10:20:33 +08:00
parent 1f39b8fe4a
commit a6c9e45f9a
1 changed files with 5 additions and 1 deletions

View File

@ -259,7 +259,11 @@ public class PerformanceTestService {
testReport.setTestId(loadTest.getId());
testReport.setName(loadTest.getName());
testReport.setTriggerMode(triggerMode);
testReport.setUserId(Optional.ofNullable(SessionUtils.getUser().getId()).orElse(loadTest.getUserId()));
if (SessionUtils.getUser() == null) {
testReport.setUserId(loadTest.getUserId());
} else {
testReport.setUserId(SessionUtils.getUser().getId());
}
// 启动测试
try {