Skip to content
Permalink
Browse files

0003623: Fix unintended side-effects involving push/pull node lists

  • Loading branch information...
mmichalek committed Jul 10, 2018
1 parent 2b421b5 commit 48139ad353f59b79f037a338ef468899e591c456
@@ -389,13 +389,14 @@ public Node findIdentity(boolean useCache, boolean logSqlError) {
long cacheTimeoutInMs = parameterService.getLong(ParameterConstants.CACHE_TIMEOUT_NODE_GROUP_LINK_IN_MS);
if (node != null) {
List<Node> list = targetNodesCache.get(eventAction.name());

if (list == null || (System.currentTimeMillis() - targetNodeLinkCacheTime.get(eventAction.toString())) >= cacheTimeoutInMs) {
list = sqlTemplate.query(getSql("selectNodePrefixSql", "findNodesWhoITargetSql"),
new NodeRowMapper(), node.getNodeGroupId(), eventAction.name());
targetNodesCache.put(eventAction.name(), list);
targetNodeLinkCacheTime.put(eventAction.toString(),System.currentTimeMillis());
}
return list;
return new ArrayList<Node>(list);
} else {
return Collections.emptyList();
}

0 comments on commit 48139ad

Please sign in to comment.
You can’t perform that action at this time.