Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,11 @@ func newRedisClient(options *RedisOptions) *redis.Client {
// to the actual instance and that the instance supports Redis streams (i.e.
// it's at least v5).
func redisPreflightChecks(client redis.UniversalClient) error {
info, err := client.Info("server").Result()
_, err := client.Ping().Result()
if err != nil {
return err
}

match := redisVersionRE.FindAllStringSubmatch(info, -1)
if len(match) < 1 {
return fmt.Errorf("could not extract redis version")
}
version := strings.TrimSpace(match[0][1])
parts := strings.Split(version, ".")
major, err := strconv.Atoi(parts[0])
if err != nil {
return err
}
if major < 5 {
return fmt.Errorf("redis streams are not supported in version %q", version)
}

return nil
}

Expand Down