Skip to content

Commit e4ec0fe

Browse files
committed
deprecated methods
1 parent 6c1061f commit e4ec0fe

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

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

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ public void start(Promise<Void> startPromise) throws Exception {
8383
private void startRefresh(Promise<Void> promise) {
8484
LOGGER.info("Starting " + this.storeName + " loading");
8585
final long startupRefreshStart = System.nanoTime();
86-
vertx.executeBlocking(p -> {
87-
try {
88-
this.refresh();
89-
p.complete();
90-
} catch (Exception e) {
91-
p.fail(e);
92-
}
93-
}, ar -> {
86+
vertx.executeBlocking(() -> {
87+
this.refresh();
88+
return null;
89+
}).onComplete(ar -> {
9490
final long startupRefreshEnd = System.nanoTime();
9591
final long startupRefreshTimeMs = (startupRefreshEnd - startupRefreshStart) / 1000000;
9692

@@ -112,15 +108,10 @@ private void startBackgroundRefresh() {
112108
vertx.setPeriodic(this.refreshIntervalMs, (id) -> {
113109
final long start = System.nanoTime();
114110

115-
vertx.executeBlocking(promise -> {
116-
try {
117-
this.refresh();
118-
promise.complete();
119-
} catch (Exception e) {
120-
promise.fail(e);
121-
}
122-
},
123-
asyncResult -> {
111+
vertx.executeBlocking(() -> {
112+
this.refresh();
113+
return null;
114+
}).onComplete(asyncResult -> {
124115
final long end = System.nanoTime();
125116
final long elapsed = ((end - start) / 1000000);
126117
this.counterStoreRefreshTimeMs.increment(elapsed);

0 commit comments

Comments
 (0)