From 1d553a88f9a507b1a60d15784012732dc9d11383 Mon Sep 17 00:00:00 2001 From: Wil Simpson Date: Sat, 7 Dec 2024 15:24:27 -0500 Subject: [PATCH] feat: added redis connection check --- pkg/repository/cacher/redis.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/repository/cacher/redis.go b/pkg/repository/cacher/redis.go index c9622ed..1283929 100644 --- a/pkg/repository/cacher/redis.go +++ b/pkg/repository/cacher/redis.go @@ -97,6 +97,10 @@ func NewRedisCache(ctx context.Context, dbPoolConf config.DBPoolConfig) (caches. Password: dbPoolConf.Master.Password, }) + err := rdb.Ping(ctx).Err() + if err != nil { + return nil, fmt.Errorf("redis ping: %w", err) + } if err := redisotel.InstrumentTracing(rdb); err != nil { return nil, fmt.Errorf("tracing instrumentation: %w", err) }