|
|
@ -150,6 +150,7 @@ public class JobFailMonitorHelper {
|
|
|
|
// send monitor email
|
|
|
|
// send monitor email
|
|
|
|
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
|
|
|
if (info!=null && info.getAlarmEmail()!=null && info.getAlarmEmail().trim().length()>0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// alarmContent
|
|
|
|
String alarmContent = "Alarm Job LogId=" + jobLog.getId();
|
|
|
|
String alarmContent = "Alarm Job LogId=" + jobLog.getId();
|
|
|
|
if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
if (jobLog.getTriggerCode() != ReturnT.SUCCESS_CODE) {
|
|
|
|
alarmContent += "<br>TriggerMsg=<br>" + jobLog.getTriggerMsg();
|
|
|
|
alarmContent += "<br>TriggerMsg=<br>" + jobLog.getTriggerMsg();
|
|
|
@ -158,10 +159,8 @@ public class JobFailMonitorHelper {
|
|
|
|
alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg();
|
|
|
|
alarmContent += "<br>HandleCode=" + jobLog.getHandleMsg();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(",")));
|
|
|
|
// email info
|
|
|
|
for (String email: emailSet) {
|
|
|
|
|
|
|
|
XxlJobGroup group = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().load(Integer.valueOf(info.getJobGroup()));
|
|
|
|
XxlJobGroup group = XxlJobAdminConfig.getAdminConfig().getXxlJobGroupDao().load(Integer.valueOf(info.getJobGroup()));
|
|
|
|
|
|
|
|
|
|
|
|
String personal = I18nUtil.getString("admin_name_full");
|
|
|
|
String personal = I18nUtil.getString("admin_name_full");
|
|
|
|
String title = I18nUtil.getString("jobconf_monitor");
|
|
|
|
String title = I18nUtil.getString("jobconf_monitor");
|
|
|
|
String content = MessageFormat.format(mailBodyTemplate,
|
|
|
|
String content = MessageFormat.format(mailBodyTemplate,
|
|
|
@ -170,6 +169,8 @@ public class JobFailMonitorHelper {
|
|
|
|
info.getJobDesc(),
|
|
|
|
info.getJobDesc(),
|
|
|
|
alarmContent);
|
|
|
|
alarmContent);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set<String> emailSet = new HashSet<String>(Arrays.asList(info.getAlarmEmail().split(",")));
|
|
|
|
|
|
|
|
for (String email: emailSet) {
|
|
|
|
|
|
|
|
|
|
|
|
// make mail
|
|
|
|
// make mail
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|