Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b7a2724f
authored
Oct 11, 2017
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
失败告警策略扩展:默认提供邮件失败告警,可扩展短信等,扩展代码位置为 "JobFailMonitorHelper.failAlarm";
parent
ed31b1b6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
doc/XXL-JOB官方文档.md
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
doc/XXL-JOB官方文档.md
View file @
b7a2724f
## 《分
布式任务调度平台XXL-JOB》
## 《分
布式任务调度平台XXL-JOB》
...
...
@@ -1021,6 +1021,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
### 6.20 版本 V1.9.0 特性[迭代中]
-
1、新增任务运行模式 "GLUE模式(NodeJS) ",支持NodeJS脚本任务;
-
2、修复任务监控线程被耗时任务阻塞的问题;
-
3、失败告警策略扩展:默认提供邮件失败告警,可扩展短信等,扩展代码位置为 "JobFailMonitorHelper.failAlarm";
### TODO LIST
-
1、任务权限管理:执行器为粒度分配权限,核心操作校验权限;
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobFailMonitorHelper.java
View file @
b7a2724f
...
...
@@ -61,7 +61,7 @@ public class JobFailMonitorHelper {
}
if
(
ReturnT
.
FAIL_CODE
==
log
.
getTriggerCode
()
||
ReturnT
.
FAIL_CODE
==
log
.
getHandleCode
())
{
// job fail,
sendMonitorEmail
(
log
);
failAlarm
(
log
);
logger
.
info
(
">>>>>>>>>>> job monitor, job fail, JobLogId:{}"
,
jobLogId
);
}
}
...
...
@@ -81,7 +81,7 @@ public class JobFailMonitorHelper {
XxlJobLog
log
=
XxlJobDynamicScheduler
.
xxlJobLogDao
.
load
(
jobLogId
);
if
(
ReturnT
.
FAIL_CODE
==
log
.
getTriggerCode
()||
ReturnT
.
FAIL_CODE
==
log
.
getHandleCode
())
{
// job fail,
sendMonitorEmail
(
log
);
failAlarm
(
log
);
logger
.
info
(
">>>>>>>>>>> job monitor last, job fail, JobLogId:{}"
,
jobLogId
);
}
}
...
...
@@ -94,10 +94,13 @@ public class JobFailMonitorHelper {
}
/**
* send monitor email
* fail alarm
*
* @param jobLog
*/
private
void
sendMonitorEmail
(
XxlJobLog
jobLog
){
private
void
failAlarm
(
XxlJobLog
jobLog
){
// send monitor email
XxlJobInfo
info
=
XxlJobDynamicScheduler
.
xxlJobInfoDao
.
loadById
(
jobLog
.
getJobId
());
if
(
info
!=
null
&&
info
.
getAlarmEmail
()!=
null
&&
info
.
getAlarmEmail
().
trim
().
length
()>
0
)
{
...
...
@@ -109,6 +112,9 @@ public class JobFailMonitorHelper {
MailUtil
.
sendMail
(
email
,
title
,
content
,
false
,
null
);
}
}
// TODO, custom alarm strategy, such as sms
}
public
void
toStop
(){
...
...
Write
Preview
Markdown
is supported
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