feat: ASW-199 调整 cron 校验

This commit is contained in:
zhangshuai
2024-11-28 15:02:42 +08:00
parent 0c5c22f567
commit 3611f9226c

View File

@@ -121,7 +121,7 @@ public class JobCfgServiceImpl extends ServiceImpl<JobCfgDao, JobCfgEntity> impl
if (T.StrUtil.equals(cfg.getType(), "cron") && cfg.getCron() == null) { if (T.StrUtil.equals(cfg.getType(), "cron") && cfg.getCron() == null) {
throw new ASWException(RCode.JOB_CFG_CRON_CANNOT_EMPTY); throw new ASWException(RCode.JOB_CFG_CRON_CANNOT_EMPTY);
} }
if (cfg.getCron() != null && !CronExpression.isValidExpression(cfg.getCron())) { if (T.StrUtil.isNotEmpty(cfg.getCron()) && !CronExpression.isValidExpression(cfg.getCron())) {
throw new ASWException(RCode.JOB_CFG_CRON_ERROR); throw new ASWException(RCode.JOB_CFG_CRON_ERROR);
} }