fix(消息通知): 修复异步发送消息时不能获取session的问题

This commit is contained in:
CaptainB 2022-03-23 10:27:30 +08:00 committed by CountryBuilder
parent b2df39b1b5
commit a76b4970d3

View File

@ -174,14 +174,8 @@ public class ApiDefinitionExecResultService {
.build();
String taskType = NoticeConstants.TaskType.API_DEFINITION_TASK;
if (SessionUtils.getUser() != null
&& StringUtils.equals(SessionUtils.getCurrentProjectId(), apiTestCaseWithBLOBs.getProjectId())
&& StringUtils.isNotEmpty(SessionUtils.getCurrentWorkspaceId())) {
noticeSendService.send(taskType, noticeModel);
} else {
Project project = projectMapper.selectByPrimaryKey(apiTestCaseWithBLOBs.getProjectId());
noticeSendService.send(project, taskType, noticeModel);
}
Project project = projectMapper.selectByPrimaryKey(apiTestCaseWithBLOBs.getProjectId());
noticeSendService.send(project, taskType, noticeModel);
} catch (Exception e) {
LogUtil.error("消息发送失败:" + e.getMessage());
}