parseRedisURL parses redis URL and returns options
(redisURL string)
| 38 | |
| 39 | // parseRedisURL parses redis URL and returns options |
| 40 | func parseRedisURL(redisURL string) *redis.Options { |
| 41 | opts, err := redis.ParseURL(redisURL) |
| 42 | if err != nil { |
| 43 | // Return default options if parse fails |
| 44 | return &redis.Options{ |
| 45 | Addr: redisURL, |
| 46 | } |
| 47 | } |
| 48 | return opts |
| 49 | } |
| 50 | |
| 51 | // newClient creates a new go-redis client |
| 52 | func newClient(redisURL string, maxIdle, maxActive int) *redis.Client { |