Skip to content

Commit

Permalink
support TLS in redis checker. (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
miya-masa authored Jul 27, 2023
1 parent 95cd9aa commit 522898b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion checks/redis/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ type Config struct {
func New(config Config) func(ctx context.Context) error {
// support all DSN formats (for backward compatibility) - with and w/out schema and path part:
// - redis://localhost:1234/
// - rediss://localhost:1234/
// - localhost:1234
redisDSN := config.DSN
if !strings.HasPrefix(redisDSN, "redis://") {
if !strings.HasPrefix(redisDSN, "redis://") && !strings.HasPrefix(redisDSN, "rediss://") {
redisDSN = fmt.Sprintf("redis://%s", redisDSN)
}
redisOptions, _ := redis.ParseURL(redisDSN)
Expand Down

0 comments on commit 522898b

Please sign in to comment.