Fixing DL4J UI system property for getting port value (#9162)

Signed-off-by: shamsulazeem <shamsazeem20@gmail.com>
master
Shams Ul Azeem 2021-01-25 04:13:34 +05:00 committed by GitHub
parent 124d0a1965
commit 7f571b3c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -369,7 +369,7 @@ public class VertxUIServer extends AbstractVerticle implements UIServer {
//Check port property
int port = instancePort == null ? DEFAULT_UI_PORT : instancePort;
String portProp = System.getenv(DL4JSystemProperties.UI_SERVER_PORT_PROPERTY);
String portProp = System.getProperty(DL4JSystemProperties.UI_SERVER_PORT_PROPERTY);
if(portProp != null && !portProp.isEmpty()){
try{
port = Integer.parseInt(portProp);
@ -378,6 +378,10 @@ public class VertxUIServer extends AbstractVerticle implements UIServer {
}
}
if (port < 0 || port > 0xFFFF) {
throw new IllegalStateException("Valid port range is 0 <= port <= 65535. The given port was " + port);
}
uiEventRoutingThread = new Thread(new StatsEventRouterRunnable());
uiEventRoutingThread.setDaemon(true);
uiEventRoutingThread.start();