commit
04af15e180
@ -56,7 +56,13 @@ public class BeatReactor {
|
|||||||
|
|
||||||
public void addBeatInfo(String serviceName, BeatInfo beatInfo) {
|
public void addBeatInfo(String serviceName, BeatInfo beatInfo) {
|
||||||
NAMING_LOGGER.info("[BEAT] adding beat: {} to beat map.", beatInfo);
|
NAMING_LOGGER.info("[BEAT] adding beat: {} to beat map.", beatInfo);
|
||||||
dom2Beat.put(buildKey(serviceName, beatInfo.getIp(), beatInfo.getPort()), beatInfo);
|
String key = buildKey(serviceName, beatInfo.getIp(), beatInfo.getPort());
|
||||||
|
BeatInfo existBeat = null;
|
||||||
|
//fix #1733
|
||||||
|
if ((existBeat = dom2Beat.remove(key)) != null) {
|
||||||
|
existBeat.setStopped(true);
|
||||||
|
}
|
||||||
|
dom2Beat.put(key, beatInfo);
|
||||||
executorService.schedule(new BeatTask(beatInfo), beatInfo.getPeriod(), TimeUnit.MILLISECONDS);
|
executorService.schedule(new BeatTask(beatInfo), beatInfo.getPeriod(), TimeUnit.MILLISECONDS);
|
||||||
MetricsMonitor.getDom2BeatSizeMonitor().set(dom2Beat.size());
|
MetricsMonitor.getDom2BeatSizeMonitor().set(dom2Beat.size());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user