Code snippet optimization

This commit is contained in:
lancer.hong
2021-10-09 22:58:13 +08:00
parent c1236ba962
commit 2e895ab7f8
2 changed files with 36 additions and 34 deletions

View File

@@ -56,7 +56,7 @@ public abstract class RedisReactiveConfig {
public ReactiveRedisConnectionFactory lettuceConnectionFactory() {
log.info("connect to " + redisReactiveProperties);
log.info("connect to {}", redisReactiveProperties);
RedisStandaloneConfiguration rcs = new RedisStandaloneConfiguration(redisReactiveProperties.getHost(), redisReactiveProperties.getPort());
String password = redisReactiveProperties.getPassword();
@@ -65,8 +65,8 @@ public abstract class RedisReactiveConfig {
}
rcs.setDatabase(redisReactiveProperties.getDatabase());
GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
poolConfig.setMaxTotal(16);
GenericObjectPoolConfig<?> poolConfig = new GenericObjectPoolConfig<>();
poolConfig.setMaxTotal(poolConfig.getMaxTotal() * 2);
LettucePoolingClientConfiguration ccs = LettucePoolingClientConfiguration.builder()
.clientResources(clientResources)
.clientOptions(ClientOptions.builder().publishOnScheduler(true).build())

View File

@@ -82,6 +82,7 @@ public class Dict {
@JsonProperty("create") long create,
@JsonProperty("update") long update
) {
this.isDeleted = isDeleted;
this.id = id;
this.key = key;
@@ -89,6 +90,7 @@ public class Dict {
this.value = value;
this.create = create;
this.update = update;
if (type == BOOLEAN) {
booleanVal = Boolean.parseBoolean(value);
} else if (type == STRING) {