github-advanced-security[bot] commented on code in PR #16821:
URL:
https://github.com/apache/dolphinscheduler/pull/16821#discussion_r1849624676
##########
dolphinscheduler-registry/dolphinscheduler-registry-api/src/main/java/org/apache/dolphinscheduler/registry/api/RegistryClient.java:
##########
@@ -222,4 +229,23 @@
private Collection<String> getServerNodes(RegistryNodeType nodeType) {
return getChildrenKeys(nodeType.getRegistryPath());
}
+
+ private void cleanHistoryFailoverFinishedNodes() {
+ // Clean the history failover finished nodes
+ // which failover is before the current time minus 1 week
+ final long maxKeepTime = DateUtils.addWeeks(new Date(), -1).getTime();
+ final Collection<String> failoverFinishedNodes =
+
registry.children(RegistryNodeType.FAILOVER_FINISH_NODES.getRegistryPath());
+ if (CollectionUtils.isEmpty(failoverFinishedNodes)) {
+ return;
+ }
+ for (final String failoverFinishedNode : failoverFinishedNodes) {
+ final String failoverFinishTime =
registry.get(failoverFinishedNode);
+ if (maxKeepTime > Long.parseLong(failoverFinishTime)) {
Review Comment:
## Missing catch of NumberFormatException
Potential uncaught 'java.lang.NumberFormatException'.
[Show more
details](https://github.com/apache/dolphinscheduler/security/code-scanning/5102)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]