Skip to content

Commit

Permalink
Switch ServerPort to an internal Record
Browse files Browse the repository at this point in the history
This gets rid of a load of code, and brings it in line with Azure and GCP

See micronaut-projects/micronaut-gcp#1008
And micronaut-projects/micronaut-azure#603
  • Loading branch information
timyates committed Dec 7, 2023
1 parent d29d5c3 commit 7a73be5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private ServerPort createServerPort(HttpServerConfiguration httpServerConfigurat
@Override
public EmbeddedServer start() {
if (running.compareAndSet(false, true)) {
int port = serverPort.getPort();
int port = serverPort.port();
try {
this.server = new Server(port);
this.server.setHandler(new AwsProxyHandler(applicationContext));
Expand Down Expand Up @@ -207,4 +207,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
baseRequest.setHandled(true);
}
}

private record ServerPort(boolean random, Integer port) {
}
}

This file was deleted.

0 comments on commit 7a73be5

Please sign in to comment.