Skip to content

Commit

Permalink
BUG : #70 redis 배포 오류수정(주소명 오류)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonjin-kim committed Mar 18, 2024
1 parent 14e5bab commit 69b6a5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/com/sideProject/PlanIT/config/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sideProject.PlanIT.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
Expand All @@ -11,9 +12,14 @@
@Configuration
@EnableRedisRepositories
public class RedisConfig {
@Value("${spring.data.redis.port}")
private int port;

@Value("${spring.data.redis.host}")
private String host;
@Bean
public RedisConnectionFactory redisConnectionFactory() {
return new LettuceConnectionFactory("localhost", 6379);
return new LettuceConnectionFactory(host, port);
}

@Bean
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ spring:
properties:
hibernate:
format_sql: true
data:
redis:
host: ${REDIS_HOST}
port: ${REDIS_PORT}

# 환경변수 설정
# - DB USER_NAME, PASSWORD
Expand Down

0 comments on commit 69b6a5b

Please sign in to comment.