Skip to content

Commit

Permalink
Merge pull request #205 from xtreme1-io/dev
Browse files Browse the repository at this point in the history
Configure redis database
  • Loading branch information
jaggerwang authored Feb 27, 2024
2 parents f46935e + 690ee9d commit 6bda4ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class RedisConfig {
@Value("${spring.redis.password}")
private String password;

@Value("${spring.redis.database}")
private int database;

@Bean
public GenericJackson2JsonRedisSerializer jsonRedisSerializer(
Jackson2ObjectMapperBuilder objectMapperBuilder) {
Expand All @@ -55,6 +58,7 @@ public Jackson2HashMapper hashMapper(ObjectMapper objectMapper) {
public LettuceConnectionFactory redisConnectionFactory() {
var serverConfig = new RedisStandaloneConfiguration(host, port);
serverConfig.setPassword(password);
serverConfig.setDatabase(database);

var clientConfig = LettucePoolingClientConfiguration.builder()
.readFrom(REPLICA_PREFERRED)
Expand Down
4 changes: 2 additions & 2 deletions backend/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ debug: false

logging:
level:
org.springframework.web.filter.CommonsRequestLoggingFilter: info
ai.basic.basicai.user.adapter.port.dao.mybatis.mapper: info
org.springframework.web.filter.CommonsRequestLoggingFilter: debug
ai.basic.basicai.user.adapter.port.dao.mybatis.mapper: debug
request:
maxPayloadLength: 100000

Expand Down

0 comments on commit 6bda4ec

Please sign in to comment.