File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed
Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 77DB_PASSWORD =
88DB_NAME =
99DB_HOST =
10+ REDIS_HOST =
1011CORES =
Original file line number Diff line number Diff line change 3535 -e GUAC_DB_PASSWORD="${{ secrets.GUAC_DB_PASSWORD }}" \
3636 -e GUAC_DB_HOST="${{ secrets.GUAC_DB_HOST }}" \
3737 -e GUAC_DB_NAME="${{ secrets.GUAC_DB_NAME }}" \
38+ -e REDIS_HOST="${{ secrets.REDIS_HOST }}" \
3839 $IMAGE
3940 docker system prune -af
Original file line number Diff line number Diff line change @@ -17,9 +17,7 @@ func main() {
1717 ctx := context .Background ()
1818
1919 // Redis 초기화
20- // 환경변수로 빼기 전까지는 로컬호스트로 하드코딩 해놓을게요.
21- // 기존에 있던 contol 개발서버에 redis 접근에는 문제가 있었습니다.
22- rdb , err := startup .InitializeRedis (ctx , "100.101.247.128:6379" )
20+ rdb , err := startup .InitializeRedis (ctx )
2321 if err != nil {
2422 log .Error ("Failed to initialize Redis: %v" , err , true )
2523 panic (err )
Original file line number Diff line number Diff line change @@ -3,18 +3,24 @@ package startup
33import (
44 "context"
55 "fmt"
6+ "os"
67
78 "github.com/easy-cloud-Knet/KWS_Control/util"
89 "github.com/redis/go-redis/v9"
910)
1011
1112// InitializeRedis Redis 클라이언트를 초기화하고 연결을 테스트합니다
12- func InitializeRedis (ctx context.Context , redisAddr string ) (* redis.Client , error ) {
13+ func InitializeRedis (ctx context.Context ) (* redis.Client , error ) {
1314 log := util .GetLogger ()
1415
16+ REDIS_HOST := os .Getenv ("REDIS_HOST" )
17+ if REDIS_HOST == "" {
18+ REDIS_HOST = "100.101.247.128:6379"
19+ }
20+
1521 // Redis 클라이언트 생성
1622 rdb := redis .NewClient (& redis.Options {
17- Addr : redisAddr ,
23+ Addr : REDIS_HOST ,
1824 })
1925
2026 // 연결 테스트
You can’t perform that action at this time.
0 commit comments