Skip to content

Commit

Permalink
Fail deployment when unable to create the vertx httpServer
Browse files Browse the repository at this point in the history
Fixes: #4124
  • Loading branch information
geoand committed Sep 20, 2019
1 parent 89db6fc commit 4b4323f
Showing 1 changed file with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -378,20 +378,30 @@ public void start(Future<Void> startFuture) throws Exception {
httpServer = vertx.createHttpServer(httpOptions);
httpServer.requestHandler(router);
httpServer.listen(port, host, event -> {
// Port may be random, so set the actual port
httpOptions.setPort(event.result().actualPort());
if (remainingCount.decrementAndGet() == 0) {
startFuture.complete();
if (event.cause() != null) {
startFuture.fail(event.cause());
} else {
// Port may be random, so set the actual port
httpOptions.setPort(event.result().actualPort());
if (remainingCount.decrementAndGet() == 0) {
startFuture.complete();
}
}

});
if (httpsOptions != null) {
httpsServer = vertx.createHttpServer(httpsOptions);
httpsServer.requestHandler(router);
httpsServer.listen(httpsPort, host, event -> {
httpsOptions.setPort(event.result().actualPort());
if (remainingCount.decrementAndGet() == 0) {
startFuture.complete();
if (event.cause() != null) {
startFuture.fail(event.cause());
} else {
httpsOptions.setPort(event.result().actualPort());
if (remainingCount.decrementAndGet() == 0) {
startFuture.complete();
}
}

});
}
}
Expand Down

0 comments on commit 4b4323f

Please sign in to comment.