...
|
...
|
@@ -203,6 +203,7 @@ public class MonitorService { |
|
|
public void run() {
|
|
|
logger.info("1'st time in AppReportTask");
|
|
|
long cnt = 0L;
|
|
|
long timeout = appRebootTimeout*1000L;
|
|
|
while(true){
|
|
|
try {
|
|
|
Thread.currentThread().sleep(5000L);
|
...
|
...
|
@@ -228,12 +229,13 @@ public class MonitorService { |
|
|
long lastUpdateDT = req.getUpdateDateTime();
|
|
|
long currentDT = System.currentTimeMillis();
|
|
|
long diff = currentDT - lastUpdateDT;
|
|
|
long timeout = appRebootTimeout*1000L;
|
|
|
|
|
|
if(diff > timeout){
|
|
|
logger.warn("AppReportMap find reeboot, req {},currentDT {}, diff {}, timeout {}",
|
|
|
req, currentDT, diff, timeout);
|
|
|
//reboot
|
|
|
//infoScreenService.reboot(req.getIp(), req.getScreenType());
|
|
|
//TODO use queue to split send mail function, use a thread to send mail
|
|
|
mailService.send(buildMailContent4AppCrash(req.getIp(), req.getScreenType()).toString(),false);
|
|
|
needRemove.add(req.getIp());
|
|
|
}
|
...
|
...
|
@@ -260,6 +262,7 @@ public class MonitorService { |
|
|
public void run() {
|
|
|
logger.info("1'st time in HeartBeatTask");
|
|
|
long cnt = 0L;
|
|
|
long timeout = heartBeatTimeout*1000L;
|
|
|
while(true){
|
|
|
try {
|
|
|
Thread.currentThread().sleep(5000L);
|
...
|
...
|
@@ -285,7 +288,7 @@ public class MonitorService { |
|
|
long lastUpdateDT = packet.getUpdateDateTime();
|
|
|
long currentDT = System.currentTimeMillis();
|
|
|
long diff = currentDT - lastUpdateDT;
|
|
|
long timeout = heartBeatTimeout*1000L;
|
|
|
|
|
|
//todo 合并多个,只发送一封邮件
|
|
|
if(diff > timeout){
|
|
|
//reboot
|
...
|
...
|
|