提交 c977ce56 编写于 作者: Z zengqiao

heartbeat表的数据更新时间从MySQL自动生成调整为Logi-KM的时间

上级 da7ad8b4
......@@ -11,7 +11,7 @@
</resultMap>
<insert id="replace" parameterType="com.xiaojukeji.kafka.manager.common.entity.pojo.HeartbeatDO">
REPLACE heartbeat (ip, hostname) VALUES (#{ip}, #{hostname})
REPLACE heartbeat (ip, hostname, modify_time) VALUES (#{ip}, #{hostname}, #{modifyTime})
</insert>
<select id="selectActiveHosts" parameterType="java.util.Date" resultMap="HeartbeatMap">
......
......@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* @author limeng
* @date 20/8/10
......@@ -30,6 +32,7 @@ public class Heartbeat {
HeartbeatDO heartbeatDO = new HeartbeatDO();
heartbeatDO.setIp(NetUtils.localIp());
heartbeatDO.setHostname(NetUtils.localHostname());
heartbeatDO.setModifyTime(new Date());
heartbeatDao.replace(heartbeatDO);
} catch (Exception e) {
LOGGER.error("flush heartbeat failed.", e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册