️ fix: Fixed the Promise completion logic in the stop method.

This commit is contained in:
jarvis2f 2025-02-07 21:00:51 +08:00
parent 9db72eeb32
commit 49af0b2f2d
2 changed files with 2 additions and 1 deletions

View file

@ -82,12 +82,12 @@ public class DataVerticle extends AbstractVerticle {
public void stop(Promise<Void> stopPromise) throws Exception {
if (pool != null) {
pool.close().onComplete(r -> {
stopPromise.complete();
if (r.succeeded()) {
log.debug("Data verticle stopped!");
} else {
log.error("Failed to close data verticle: %s".formatted(r.cause().getMessage()));
}
stopPromise.complete();
});
}
}

View file

@ -64,6 +64,7 @@ public class Start {
return;
}
vertx.undeploy(httpVerticle.deploymentID())
.compose(r -> vertx.undeploy(dataVerticle.deploymentID()))
.onComplete(res -> {
if (res.succeeded()) {
log.info("👋 Shutdown success");