Skip to content

Commit fdf82d2

Browse files
committed
[代码优化](v2.6):定时任务告警邮箱优化,邮箱为空不调用发送逻辑
1 parent 9fc0524 commit fdf82d2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
* @date 2019-01-07
4343
*/
4444
@Async
45-
@SuppressWarnings({"unchecked","all"})
4645
public class ExecutionJob extends QuartzJobBean {
4746

4847
/** 该处仅供参考 */
@@ -108,8 +107,10 @@ public void executeInternal(JobExecutionContext context) {
108107
if(quartzJob.getEmail() != null){
109108
EmailService emailService = SpringContextHolder.getBean(EmailService.class);
110109
// 邮箱报警
111-
EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
112-
emailService.send(emailVo, emailService.find());
110+
if(StringUtils.isNoneBlank(quartzJob.getEmail())){
111+
EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
112+
emailService.send(emailVo, emailService.find());
113+
}
113114
}
114115
} finally {
115116
quartzLogRepository.save(log);

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<log4jdbc.version>1.16</log4jdbc.version>
3434
<swagger.version>2.9.2</swagger.version>
3535
<fastjson.version>1.2.70</fastjson.version>
36-
<druid.version>1.1.22</druid.version>
36+
<druid.version>1.1.24</druid.version>
3737
<commons-pool2.version>2.5.0</commons-pool2.version>
3838
<mapstruct.version>1.3.1.Final</mapstruct.version>
3939
</properties>

0 commit comments

Comments
 (0)