Skip to content

Commit

Permalink
feat: add integrity check for props
Browse files Browse the repository at this point in the history
  • Loading branch information
gb-cic committed Dec 11, 2023
1 parent af70dee commit a460ab7
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void postConstruct() {
});
}
}
integrity();
}

@Override
Expand All @@ -70,4 +71,14 @@ private void refresh(ConfigItemTypeEnum type, String name) {
String prop = client.getProps(type, name, previous);
props.put(name, Pair.of(new Date().getTime(), prop));
}

private void integrity() {
String err = "Missing props {} from rules-manager";
String[] out = new String[]{
PROPS_NAME_CONTROL_LOG_ENABLED,
};
for (String prop : out) {
if(!props.containsKey(prop)) throw new IllegalStateException(err.replace("{}", prop));
}
}
}

0 comments on commit a460ab7

Please sign in to comment.