Skip to content

Commit

Permalink
fix parsing of port number for redis db
Browse files Browse the repository at this point in the history
  • Loading branch information
benleb committed Jun 13, 2023
1 parent 18ea6d4 commit 9e56f81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/rueidica/rueidica.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ func (r *Rueidica) NotificationLockWtihDuration(ctx context.Context, txID common
splittedAddress := strings.Split(viper.GetString("redis.address"), ":")

host := net.ParseIP(splittedAddress[0])
port, _ := strconv.ParseInt(splittedAddress[1], 10, 64)
port, _ := strconv.ParseUint(splittedAddress[1], 10, 16)

connectAddr = &net.TCPAddr{IP: host, Port: int(port)}
} else {
// fallback to old config
connectAddr = &net.TCPAddr{IP: net.ParseIP(viper.GetString("redis.host")), Port: viper.GetInt("redis.port")}
connectAddr = &net.TCPAddr{IP: net.ParseIP(viper.GetString("redis.host")), Port: int(viper.GetUint16("redis.port"))}
}

// Create a pool with go-redis (or redigo) which is the pool redisync will
Expand Down

0 comments on commit 9e56f81

Please sign in to comment.