rombert commented on a change in pull request #1: SLING-8764
URL:
https://github.com/apache/sling-org-apache-sling-commons-scheduler/pull/1#discussion_r338468432
##########
File path:
src/main/java/org/apache/sling/commons/scheduler/impl/GaugesSupport.java
##########
@@ -227,12 +224,20 @@ public Long getValue() {
}
};
logger.debug("createGauge: registering gauge : " + gaugeName);
- this.metricRegistry.register(gaugeName, gauge);
+ try {
+ this.metricRegistry.register(gaugeName, gauge);
+ } catch (IllegalArgumentException e) {
+ this.metricRegistry.remove(gaugeName);
+ logger.warn("createGauge: re-registering gauge : " + gaugeName);
+ this.metricRegistry.register(gaugeName, gauge);
+ }
+ logger.info("createGauge: registered gauge : " + gaugeName);
+ registeredGaugeNameList.add(gaugeName);
}
private Long getOldestRunningJobMillis(final ConfigHolder configHolder,
- final String threadPoolNameOrNull,
- final String filterNameOrNull) {
+ final String threadPoolNameOrNull,
Review comment:
Please avoid whitespace-only changes.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services