Skip to content

Commit

Permalink
Remove malformed check for already used ports (fixes gretty-gradle-pl…
Browse files Browse the repository at this point in the history
…ugin#147)

Because gretty-gradle-plugin#138 removed adequate error handling, the check for
already used ports was broken and caused Gretty to fail in
case the 'gretty_ports.properties' file was present.

I think the check is now obsolete because gretty-gradle-plugin#138 removed the
ability to manually specify fixed service and status ports
for Gretty. As a result, Gretty's ports will never clash
from one Gretty invocation to the next.

If the check was restored, it would only check if the
previous Gretty invocation had already terminated.

If one of the *servlet container ports* clashed, I deem
the current behavior (BindException) sufficient.
  • Loading branch information
f4lco committed Apr 13, 2020
1 parent 2c98d0a commit 2219379
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ abstract class LauncherBase implements Launcher {

File portPropertiesFile = getPortPropertiesFile()
portPropertiesFile.parentFile.mkdirs()
if(portPropertiesFile.exists()) {
Properties portProps = new Properties()
portPropertiesFile.withReader 'UTF-8', {
portProps.load(it)
}
int servicePort = portProps.servicePort as int
int statusPort = portProps.statusPort as int
ServiceProtocol.createReader(statusPort).withCloseable { reader ->
def response = reader.readMessageAsync()
ServiceProtocol.createWriter(servicePort).write('status')
if (response.get() == 'started')
throw new RuntimeException('Web-server is already running.')
}
}
}

@Override
Expand Down

0 comments on commit 2219379

Please sign in to comment.