Skip to content

Commit

Permalink
[chore] redis 연결 성공 시의 로직 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
JeonHaeseung committed Jul 9, 2024
1 parent 2143a21 commit 010223d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/Ness/Backend/infra/redis/RedisConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package Ness.Backend.infra.redis;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -13,6 +14,7 @@
import java.time.Duration;

@Configuration
@Slf4j
public class RedisConfig {

@Value("${spring.data.redis.host}")
Expand All @@ -35,6 +37,8 @@ public RedisConnectionFactory redisConnectionFactory() {
.commandTimeout(Duration.ofSeconds(1)) //No longer than 1 second
.shutdownTimeout(Duration.ZERO) //Immediately shutdown after application shutdown
.build();

log.info("Connected to Redis at {}:{}", host, port);
return new LettuceConnectionFactory(redisConfig, clientConfig);
}

Expand Down

0 comments on commit 010223d

Please sign in to comment.