Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
0003013: Update the heartbeat (sym_node_host) immediately on
registration
  • Loading branch information
chenson42 committed Mar 14, 2017
1 parent 1076764 commit 6897d83
Showing 1 changed file with 10 additions and 5 deletions.
Expand Up @@ -20,6 +20,8 @@
*/
package org.jumpmind.symmetric.service.impl;

import static org.apache.commons.lang.StringUtils.isNotBlank;

import java.io.IOException;
import java.io.OutputStream;
import java.net.ConnectException;
Expand Down Expand Up @@ -560,11 +562,14 @@ protected String openRegistration(Node node, String remoteHost, String remoteAdd
password = filterPasswordOnSaveIfNeeded(password);
sqlTemplate.update(getSql("openRegistrationNodeSecuritySql"), new Object[] {
nodeId, password, masterToMasterOnly ? null : me.getNodeId() });
NodeHost nodeHost = new NodeHost(node.getNodeId());
nodeHost.setHeartbeatTime(new Date());
nodeHost.setIpAddress(remoteAddress);
nodeHost.setHostName(remoteHost);
nodeService.updateNodeHost(nodeHost);

if (isNotBlank(remoteHost)) {
NodeHost nodeHost = new NodeHost(node.getNodeId());
nodeHost.setHeartbeatTime(new Date());
nodeHost.setIpAddress(remoteAddress);
nodeHost.setHostName(remoteHost);
nodeService.updateNodeHost(nodeHost);
}
nodeService.flushNodeAuthorizedCache();
nodeService.flushNodeCache();
nodeService.insertNodeGroup(node.getNodeGroupId(), null);
Expand Down

0 comments on commit 6897d83

Please sign in to comment.