스프링 스케줄러를 이용하여 콘텐츠 예약 오픈 설정
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package kr.co.vividnext.sodalive.configs
|
||||
|
||||
import org.redisson.Redisson
|
||||
import org.redisson.api.RedissonClient
|
||||
import org.redisson.config.Config
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.cache.annotation.EnableCaching
|
||||
import org.springframework.context.annotation.Bean
|
||||
@@ -26,6 +29,17 @@ class RedisConfig(
|
||||
@Value("\${spring.redis.port}")
|
||||
private val port: Int
|
||||
) {
|
||||
@Bean
|
||||
fun redissonClient(): RedissonClient {
|
||||
val config = Config()
|
||||
config.useSingleServer()
|
||||
.setAddress("redis://$host:$port")
|
||||
.setConnectionMinimumIdleSize(1) // 최소 유휴 연결: 1
|
||||
.setConnectionPoolSize(5) // 최대 연결 풀 크기: 5
|
||||
|
||||
return Redisson.create(config)
|
||||
}
|
||||
|
||||
@Bean
|
||||
fun redisConnectionFactory(): RedisConnectionFactory {
|
||||
val clientConfiguration = LettuceClientConfiguration.builder()
|
||||
|
Reference in New Issue
Block a user