Skip to content

Commit

Permalink
check null before convert it to boolean, and use parameterized logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Xin committed Aug 3, 2023
1 parent 094e640 commit a2956b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void start() {

String redisHost = (String) props.get("redis.host");
Integer redisPort = (Integer) props.get("redis.port");
Boolean redisEnableTls = (Boolean) props.get("redis.enableTls");
boolean redisEnableTls = props.get("redis.enableTls") != null ? (Boolean) props.get("redis.enableTls") : false;

props.put(ExpansionHandler.MAX_EXPANSION_LEVEL_HARD_PROPERTY, "100");
props.put(ExpansionHandler.MAX_EXPANSION_LEVEL_SOFT_PROPERTY, "50");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,8 @@ public static void deployModules(final Vertx vertx, Class verticleClass, Map<Str
final Logger log = LoggerFactory.getLogger(verticleClass);
String redisHost = (String) props.get("redis.host");
Integer redisPort = (Integer) props.get("redis.port");
Boolean redisEnableTls = (Boolean) props.get("redis.enableTls");
log.info("deploying redis module with host:" + redisHost + " port:" + redisPort + " TLS: " + redisEnableTls);
boolean redisEnableTls = props.get("redis.enableTls") != null ? (Boolean) props.get("redis.enableTls") : false;
log.info("deploying redis module with host: {}, port: {}, TLS: {}", redisHost, redisPort, redisEnableTls);

// redisques module
vertx.deployVerticle("org.swisspush.redisques.RedisQues", new DeploymentOptions().setConfig(RunConfig.buildRedisquesConfig()).setInstances(4), event -> {
Expand Down

0 comments on commit a2956b8

Please sign in to comment.