Skip to content

Commit

Permalink
Fix: #125 RedisConfig에 password 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJae-H committed Aug 17, 2024
1 parent 8f63a7a commit ac77865
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion genti-auth/src/main/java/com/gt/genti/config/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
Expand All @@ -24,9 +25,16 @@ public class RedisConfig {
@Value("${redis.port}")
private int port;

@Value("${redis.password}")
private String password;

@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory(host, port);
RedisStandaloneConfiguration redisConfiguration = new RedisStandaloneConfiguration();
redisConfiguration.setHostName(host);
redisConfiguration.setPort(port);
redisConfiguration.setPassword(password);
return new LettuceConnectionFactory(redisConfiguration);
}

@Bean
Expand Down

0 comments on commit ac77865

Please sign in to comment.