package com.iailab.module.job.task;
|
|
import com.iailab.module.watch.WatchConstant;
|
import com.iailab.module.watch.WatchDog;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import javax.annotation.Resource;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* ZX1心跳
|
* 0/2 * * * * ?
|
*
|
* @author PanZhibao
|
* @Description
|
* @createTime 2024年06月04日
|
*/
|
@Component("watchDogZX1Task")
|
public class WatchDogZX1Task implements ITask {
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
@Resource
|
private WatchDog watchDog;
|
|
private int lastHeat = 0;
|
|
private final String mParamCode = "isWriteTime";
|
|
@Override
|
public void run(String params) {
|
// logger.info("WatchDogZX1Task定时任务正在执行,参数为:{}", params);
|
try {
|
lastHeat = watchDog.writeWatchDogTime(WatchConstant.ZX1_HEART_SET, WatchConstant.ZX1_HEART,
|
WatchConstant.ZX1_STATUS, lastHeat);
|
} catch (Exception ex) {
|
logger.error("WatchDogZX1Task运行异常");
|
ex.printStackTrace();
|
}
|
logger.info("WatchDogZX1Task运行完成");
|
}
|
}
|