feat:(1.3.0-beta1): 1.修复工作流通知配置为null问题

This commit is contained in:
opensnail 2024-12-27 23:19:43 +08:00
parent d21c779a23
commit 37c4adb370
2 changed files with 4 additions and 3 deletions

View File

@ -157,7 +157,7 @@ public class ClientRegister extends AbstractRegister {
}
if (CollUtil.isEmpty(waitRefreshDBClientNodes)) {
SnailJobLog.LOCAL.warn("clientNodes is empty");
SnailJobLog.LOCAL.debug("clientNodes is empty");
return;
}

View File

@ -48,6 +48,7 @@ import com.aizuda.snailjob.template.datasource.persistence.po.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.common.graph.ElementOrder;
import com.google.common.graph.GraphBuilder;
import com.google.common.graph.MutableGraph;
@ -127,7 +128,7 @@ public class WorkflowServiceImpl implements WorkflowService {
HashUtil.bkdrHash(workflowRequestVO.getGroupName() + workflowRequestVO.getWorkflowName())
% systemProperties.getBucketTotal());
workflow.setNamespaceId(UserSessionUtils.currentUserSession().getNamespaceId());
workflow.setNotifyIds(JsonUtil.toJsonString(workflowRequestVO.getNotifyIds()));
workflow.setNotifyIds(JsonUtil.toJsonString(Optional.ofNullable(workflowRequestVO.getNotifyIds()).orElse(Sets.newHashSet())));
workflow.setId(null);
Assert.isTrue(1 == workflowMapper.insert(workflow), () -> new SnailJobServerException("新增工作流失败"));
@ -226,7 +227,7 @@ public class WorkflowServiceImpl implements WorkflowService {
workflow.setVersion(version);
workflow.setNextTriggerAt(calculateNextTriggerAt(workflowRequestVO, DateUtils.toNowMilli()));
workflow.setFlowInfo(JsonUtil.toJsonString(GraphUtils.serializeGraphToJson(graph)));
workflow.setNotifyIds(JsonUtil.toJsonString(workflowRequestVO.getNotifyIds()));
workflow.setNotifyIds(JsonUtil.toJsonString(Optional.ofNullable(workflowRequestVO.getNotifyIds()).orElse(Sets.newHashSet())));
// 不允许更新组
workflow.setGroupName(null);
Assert.isTrue(