diff --git a/cache/redis.go b/cache/redis.go index 970130c..3975e71 100644 --- a/cache/redis.go +++ b/cache/redis.go @@ -22,9 +22,13 @@ func NewRedisCache(redisURL string, d time.Duration) (Cache, error) { } rdb := redis.NewClient(ropts) + err = rdb.Ping(context.Background()).Err() + if err != nil { + return nil, err + } + c.client = rdb c.duration = d - return c, nil }