Skip to content

Commit

Permalink
Set default value when there's no option in config file (#82)
Browse files Browse the repository at this point in the history
* getOrDefault

* Fix printErrors
  • Loading branch information
yixinglu authored Jan 12, 2023
1 parent b363646 commit 3290469
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public NebulaDbConnectionState(Map<String, String> properties, NebulaQueryStore
password = properties.get("password");
String endPoint = properties.get("endpoint");
spaceName = properties.get("spaceName");
printErrors = Boolean.parseBoolean(properties.get("printErrors"));
int maxConnSize = Integer.parseInt(properties.get("max_conn_size"));
printErrors = Boolean.parseBoolean(properties.getOrDefault("printErrors", "false"));
int maxConnSize = Integer.parseInt(properties.getOrDefault("max_conn_size", "500"));

NebulaPoolConfig nebulaPoolConfig = new NebulaPoolConfig();
nebulaPoolConfig.setMaxConnSize(maxConnSize);
Expand Down

0 comments on commit 3290469

Please sign in to comment.