Skip to content

Commit

Permalink
0.24.1
Browse files Browse the repository at this point in the history
Fix history watch subscriptions not updating when a standalone link loses connection to broker.
  • Loading branch information
a-hansen authored Nov 4, 2020
1 parent 99438fe commit b36c7b3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ subprojects {
apply plugin: 'java-library'
apply plugin: 'maven'

version = '0.24.0'
version = '0.24.1'
sourceCompatibility = 1.7
targetCompatibility = 1.7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,38 +169,38 @@ private long findInitialDelayOfLogging(long now) {
*/
public void subscribe() {
Map<String, Node> children = node.getChildren();
Watch watch;
for (Node n : children.values()) {
if (n.getAction() == null) {
Value useNewEncodingMethod = n.getConfig(Watch.USE_NEW_ENCODING_METHOD_CONFIG_NAME);
if (useNewEncodingMethod == null || !useNewEncodingMethod.getBool()) {
String path = n.getName().replaceAll("%2F", "/").replaceAll("%2E", ".");
// JTH: This was added to prevent watches to be re-added
// disconnection/reconnection.
if (containsWatch(path)) {
continue;
watch = getWatch(path);
if (watch == null) {
initWatch(path, false);
} else {
db.getProvider().getPool().subscribe(path, watch);
}

initWatch(path, false);
} else {
String path = StringUtils.decodeName(n.getName());
if (containsWatch(path)) {
continue;
watch = getWatch(path);
if (watch == null) {
initWatch(path, true);
} else {
db.getProvider().getPool().subscribe(path, watch);
}

initWatch(path, true);
}
}
}
}

private boolean containsWatch(String path) {
private Watch getWatch(String path) {
for (Watch watch : watches) {
if (watch.getPath().equals(path)) {
return true;
return watch;
}
}

return false;
return null;
}

/**
Expand Down

0 comments on commit b36c7b3

Please sign in to comment.