Skip to content

Commit

Permalink
feat: added redis connection check
Browse files Browse the repository at this point in the history
  • Loading branch information
Wil Simpson committed Dec 7, 2024
1 parent 74e7efe commit 1d553a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/repository/cacher/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1d553a8

Please sign in to comment.