⚡️ fix: Fixed the Promise completion logic in the stop method.
This commit is contained in:
parent
9db72eeb32
commit
49af0b2f2d
2 changed files with 2 additions and 1 deletions
|
|
@ -82,12 +82,12 @@ public class DataVerticle extends AbstractVerticle {
|
||||||
public void stop(Promise<Void> stopPromise) throws Exception {
|
public void stop(Promise<Void> stopPromise) throws Exception {
|
||||||
if (pool != null) {
|
if (pool != null) {
|
||||||
pool.close().onComplete(r -> {
|
pool.close().onComplete(r -> {
|
||||||
stopPromise.complete();
|
|
||||||
if (r.succeeded()) {
|
if (r.succeeded()) {
|
||||||
log.debug("Data verticle stopped!");
|
log.debug("Data verticle stopped!");
|
||||||
} else {
|
} else {
|
||||||
log.error("Failed to close data verticle: %s".formatted(r.cause().getMessage()));
|
log.error("Failed to close data verticle: %s".formatted(r.cause().getMessage()));
|
||||||
}
|
}
|
||||||
|
stopPromise.complete();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ public class Start {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
vertx.undeploy(httpVerticle.deploymentID())
|
vertx.undeploy(httpVerticle.deploymentID())
|
||||||
|
.compose(r -> vertx.undeploy(dataVerticle.deploymentID()))
|
||||||
.onComplete(res -> {
|
.onComplete(res -> {
|
||||||
if (res.succeeded()) {
|
if (res.succeeded()) {
|
||||||
log.info("👋 Shutdown success");
|
log.info("👋 Shutdown success");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue