Skip to content

Commit eb622d6

Browse files
authored
Make redis backend options work with rest
1 parent be628e3 commit eb622d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

backend/redis/redis.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ func WithBlockTimeout(timeout time.Duration) RedisBackendOption {
2525
}
2626
}
2727

28+
func WithBackendOptions(opts ...backend.BackendOption) RedisBackendOption {
29+
return func(o *RedisOptions) {
30+
for _, opt := range opts {
31+
opt(&o.Options)
32+
}
33+
}
34+
}
35+
2836
func NewRedisBackend(address, username, password string, db int, opts ...RedisBackendOption) (backend.Backend, error) {
2937
client := redis.NewUniversalClient(&redis.UniversalOptions{
3038
Addrs: []string{address},

0 commit comments

Comments
 (0)