|
9 | 9 | "time" |
10 | 10 |
|
11 | 11 | "github.com/digitalocean/go-workers2/storage" |
12 | | - "github.com/go-redis/redis/v8" |
| 12 | + "github.com/redis/go-redis/v9" |
13 | 13 | ) |
14 | 14 |
|
15 | 15 | const ( |
@@ -80,26 +80,26 @@ func processOptions(options Options) (Options, error) { |
80 | 80 |
|
81 | 81 | if options.ServerAddr != "" { |
82 | 82 | options.client = redis.NewClient(&redis.Options{ |
83 | | - IdleTimeout: redisIdleTimeout, |
84 | | - Password: options.Password, |
85 | | - DB: options.Database, |
86 | | - PoolSize: options.PoolSize, |
87 | | - Addr: options.ServerAddr, |
88 | | - TLSConfig: options.RedisTLSConfig, |
| 83 | + ConnMaxIdleTime: redisIdleTimeout, |
| 84 | + Password: options.Password, |
| 85 | + DB: options.Database, |
| 86 | + PoolSize: options.PoolSize, |
| 87 | + Addr: options.ServerAddr, |
| 88 | + TLSConfig: options.RedisTLSConfig, |
89 | 89 | }) |
90 | 90 | } else if options.SentinelAddrs != "" { |
91 | 91 | if options.RedisMasterName == "" { |
92 | 92 | return Options{}, errors.New("Sentinel configuration requires a master name") |
93 | 93 | } |
94 | 94 |
|
95 | 95 | options.client = redis.NewFailoverClient(&redis.FailoverOptions{ |
96 | | - IdleTimeout: redisIdleTimeout, |
97 | | - Password: options.Password, |
98 | | - DB: options.Database, |
99 | | - PoolSize: options.PoolSize, |
100 | | - SentinelAddrs: strings.Split(options.SentinelAddrs, ","), |
101 | | - MasterName: options.RedisMasterName, |
102 | | - TLSConfig: options.RedisTLSConfig, |
| 96 | + ConnMaxIdleTime: redisIdleTimeout, |
| 97 | + Password: options.Password, |
| 98 | + DB: options.Database, |
| 99 | + PoolSize: options.PoolSize, |
| 100 | + SentinelAddrs: strings.Split(options.SentinelAddrs, ","), |
| 101 | + MasterName: options.RedisMasterName, |
| 102 | + TLSConfig: options.RedisTLSConfig, |
103 | 103 | }) |
104 | 104 | } else { |
105 | 105 | return Options{}, errors.New("Options requires either the Server or Sentinels option") |
|
0 commit comments