Skip to content

Commit

Permalink
0002350: setting suspend=1 on sym_node_channel_ctl gets set back to 0
Browse files Browse the repository at this point in the history
when extract happens
  • Loading branch information
chenson42 committed Jul 29, 2015
1 parent 480e897 commit de7e25b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Expand Up @@ -66,6 +66,8 @@ public interface IConfigurationService {
public void saveNodeChannel(NodeChannel channel, boolean reloadChannels);

public void saveNodeChannelControl(NodeChannel channel, boolean reloadChannels);

public void updateLastExtractTime(NodeChannel channel);

public void deleteChannel(Channel channel);

Expand Down
Expand Up @@ -606,5 +606,10 @@ public Map<String, String> getRegistrationRedirectMap() {
return this.sqlTemplate.queryForMap(getSql("getRegistrationRedirectSql"),
"registrant_external_id", "registration_node_id");
}

@Override
public void updateLastExtractTime(NodeChannel channel) {
sqlTemplate.update(getSql("updateNodeChannelLastExtractTime"), channel.getLastExtractTime(), channel.getChannelId(), channel.getNodeId());
}

}
Expand Up @@ -31,6 +31,8 @@ public ConfigurationServiceSqlMap(IDatabasePlatform platform,
super(platform, replacementTokens);

// @formatter:off

putSql("updateNodeChannelLastExtractTime", "update $(node_channel_ctl) set last_extract_time=? where channel_id=? and node_id=?");

putSql("selectDataEventActionsByIdSql",
" select data_event_action from $(node_group_link) where "
Expand Down
Expand Up @@ -603,7 +603,7 @@ protected List<OutgoingBatch> extract(ProcessInfo processInfo, Node targetNode,
NodeChannel nodeChannel = configurationService.getNodeChannel(channelProcessed, targetNode.getNodeId(), false);
if (nodeChannel != null) {
nodeChannel.setLastExtractTime(now.getTime());
configurationService.saveNodeChannelControl(nodeChannel, false);
configurationService.updateLastExtractTime(nodeChannel);
}
}

Expand Down

0 comments on commit de7e25b

Please sign in to comment.