Skip to content

Commit

Permalink
dht-server add port
Browse files Browse the repository at this point in the history
  • Loading branch information
zpqsunny committed Jan 28, 2021
1 parent 67096cf commit d162456
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dht-server/src/main/java/me/zpq/server/ServerApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private static void readConfig() throws IOException {
private static void readEnv() {
// docker
String host = System.getenv("HOST");
String port = System.getenv("PORT");
String minNodes = System.getenv("MIN_NODES");
String maxNodes = System.getenv("MAX_NODES");
String redisHost = System.getenv("REDIS_HOST");
Expand All @@ -146,6 +147,10 @@ private static void readEnv() {
log.info("=> env HOST: {}", host);
HOST = host;
}
if (port != null && !port.isEmpty()) {
log.info("=> env PORT: {}", port);
PORT = Integer.parseInt(port);
}
if (minNodes != null && !minNodes.isEmpty()) {
log.info("=> env MIN_NODES: {}", minNodes);
MIN_NODES = Integer.parseInt(minNodes);
Expand Down

0 comments on commit d162456

Please sign in to comment.