| Conditions | 2 |
| Total Lines | 16 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package infrastructures |
||
| 35 | func NewRedisClient() *redis.Client { |
||
| 36 | var redisHost string |
||
| 37 | if config.IsDevelopment() { |
||
| 38 | redisHost = config.EnvHelper.GetEnv("DEBUG_REDIS_URL") |
||
| 39 | } else { |
||
| 40 | redisHost = config.EnvHelper.GetEnv("REDIS_URL") |
||
| 41 | } |
||
| 42 | |||
| 43 | client := redis.NewClient(&redis.Options{ |
||
| 44 | Addr: redisHost, |
||
| 45 | MinIdleConns: config.RedisMinIdleConns, |
||
| 46 | PoolSize: config.RedisPoolSize, |
||
| 47 | PoolTimeout: config.RedisPoolTimeout, |
||
| 48 | }) |
||
| 49 | |||
| 50 | return client |
||
| 51 | } |
||
| 52 |