Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Eladmin
Commits
fdf82d24
Commit
fdf82d24
authored
Jan 29, 2021
by
zhengjie
Browse files
[代码优化](v2.6):定时任务告警邮箱优化,邮箱为空不调用发送逻辑
parent
9fc05249
Changes
2
Hide whitespace changes
Inline
Side-by-side
eladmin-system/src/main/java/me/zhengjie/modules/quartz/utils/ExecutionJob.java
View file @
fdf82d24
...
@@ -42,7 +42,6 @@ import java.util.concurrent.*;
...
@@ -42,7 +42,6 @@ import java.util.concurrent.*;
* @date 2019-01-07
* @date 2019-01-07
*/
*/
@Async
@Async
@SuppressWarnings
({
"unchecked"
,
"all"
})
public
class
ExecutionJob
extends
QuartzJobBean
{
public
class
ExecutionJob
extends
QuartzJobBean
{
/** 该处仅供参考 */
/** 该处仅供参考 */
...
@@ -108,8 +107,10 @@ public class ExecutionJob extends QuartzJobBean {
...
@@ -108,8 +107,10 @@ public class ExecutionJob extends QuartzJobBean {
if
(
quartzJob
.
getEmail
()
!=
null
){
if
(
quartzJob
.
getEmail
()
!=
null
){
EmailService
emailService
=
SpringContextHolder
.
getBean
(
EmailService
.
class
);
EmailService
emailService
=
SpringContextHolder
.
getBean
(
EmailService
.
class
);
// 邮箱报警
// 邮箱报警
EmailVo
emailVo
=
taskAlarm
(
quartzJob
,
ThrowableUtil
.
getStackTrace
(
e
));
if
(
StringUtils
.
isNoneBlank
(
quartzJob
.
getEmail
())){
emailService
.
send
(
emailVo
,
emailService
.
find
());
EmailVo
emailVo
=
taskAlarm
(
quartzJob
,
ThrowableUtil
.
getStackTrace
(
e
));
emailService
.
send
(
emailVo
,
emailService
.
find
());
}
}
}
}
finally
{
}
finally
{
quartzLogRepository
.
save
(
log
);
quartzLogRepository
.
save
(
log
);
...
...
pom.xml
View file @
fdf82d24
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<log4jdbc.version>
1.16
</log4jdbc.version>
<log4jdbc.version>
1.16
</log4jdbc.version>
<swagger.version>
2.9.2
</swagger.version>
<swagger.version>
2.9.2
</swagger.version>
<fastjson.version>
1.2.70
</fastjson.version>
<fastjson.version>
1.2.70
</fastjson.version>
<druid.version>
1.1.2
2
</druid.version>
<druid.version>
1.1.2
4
</druid.version>
<commons-pool2.version>
2.5.0
</commons-pool2.version>
<commons-pool2.version>
2.5.0
</commons-pool2.version>
<mapstruct.version>
1.3.1.Final
</mapstruct.version>
<mapstruct.version>
1.3.1.Final
</mapstruct.version>
</properties>
</properties>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment