mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
heartbeat表的数据更新时间从MySQL自动生成调整为Logi-KM的时间
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user