Skip to content

Commit 9c44b44

Browse files
committed
remove boolean, since we only want to track success, don't care about faluire as they are logged already
1 parent fa24965 commit 9c44b44

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/com/uid2/shared/vertx/RotatingStoreVerticle.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import java.util.concurrent.atomic.AtomicInteger;
1717
import java.util.concurrent.atomic.AtomicLong;
18-
import java.util.function.Consumer;
1918

2019
public class RotatingStoreVerticle extends AbstractVerticle {
2120
private static final Logger LOGGER = LoggerFactory.getLogger(RotatingStoreVerticle.class);
@@ -32,7 +31,7 @@ public class RotatingStoreVerticle extends AbstractVerticle {
3231
private final AtomicLong latestVersion = new AtomicLong(-1L);
3332
private final AtomicLong latestEntryCount = new AtomicLong(-1L);
3433
private final AtomicInteger storeRefreshIsFailing = new AtomicInteger(0);
35-
private final Consumer<Boolean> refreshCallback;
34+
private final Runnable refreshCallback;
3635

3736
private final long refreshIntervalMs;
3837

@@ -41,7 +40,7 @@ public RotatingStoreVerticle(String storeName, long refreshIntervalMs, IMetadata
4140
}
4241

4342
public RotatingStoreVerticle(String storeName, long refreshIntervalMs, IMetadataVersionedStore versionedStore,
44-
Consumer<Boolean> refreshCallback) {
43+
Runnable refreshCallback) {
4544
this.healthComponent = HealthManager.instance.registerComponent(storeName + "-rotator");
4645
this.healthComponent.setHealthStatus(false, "not started");
4746

@@ -127,15 +126,12 @@ private void startBackgroundRefresh() {
127126
this.counterStoreRefreshFailures.increment();
128127
this.storeRefreshIsFailing.set(1);
129128
LOGGER.error("Failed to load " + this.storeName + ", " + elapsed + " ms", asyncResult.cause());
130-
if (this.refreshCallback != null) {
131-
this.refreshCallback.accept(false);
132-
}
133129
} else {
134130
this.counterStoreRefreshed.increment();
135131
this.storeRefreshIsFailing.set(0);
136132
LOGGER.trace("Successfully refreshed " + this.storeName + ", " + elapsed + " ms");
137133
if (this.refreshCallback != null) {
138-
this.refreshCallback.accept(true);
134+
this.refreshCallback.run();
139135
}
140136
}
141137
}

0 commit comments

Comments
 (0)