Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/config/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,5 @@ func ConfigureSink(v *viper.Viper) {
ConfigureKafkaConfiguration(v, "sink")

// Override Kafka configuration defaults
v.SetDefault("sink.kafka.consumerGroupId", "openmeter-sink-worker")
v.SetDefault("sink.kafka.consumerGroupID", "openmeter-sink-worker")
}
1 change: 1 addition & 0 deletions app/config/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ func DecodeHook() mapstructure.DecodeHookFunc {
mapstructure.TextUnmarshallerHookFunc(),
mapstructure.StringToTimeDurationHookFunc(),
mapstructure.StringToSliceHookFunc(","),
mapstructure.StringToBasicTypeHookFunc(),
)
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package redis
import (
"crypto/tls"
"fmt"
"strings"

"github.com/redis/go-redis/extra/redisotel/v9"
"github.com/redis/go-redis/v9"
Expand Down Expand Up @@ -57,9 +58,14 @@ func NewClient(o Options, opts ...Option) (*redis.Client, error) {
// Initialize Redis Client
var client *redis.Client
if o.Sentinel.Enabled {
// Address may be a comma-separated list of sentinel nodes.
sentinelAddrs := strings.Split(o.Address, ",")
for i, a := range sentinelAddrs {
sentinelAddrs[i] = strings.TrimSpace(a)
}
client = redis.NewFailoverClient(&redis.FailoverOptions{
MasterName: o.Sentinel.MasterName,
SentinelAddrs: []string{o.Address},
SentinelAddrs: sentinelAddrs,
DB: o.Database,
Username: o.Username,
Password: o.Password,
Expand Down
8 changes: 4 additions & 4 deletions tools/migrate/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"bufio"
"bytes"
"io/fs"
"path/filepath"
"path"
"strings"
)

Expand All @@ -29,15 +29,15 @@ func (s *SourceWrapper) Open(name string) (fs.File, error) {
return s.fsys.Open(name)
}

func (s *SourceWrapper) ReadDir(path string) ([]fs.DirEntry, error) {
entries, err := fs.ReadDir(s.fsys, path)
func (s *SourceWrapper) ReadDir(dir string) ([]fs.DirEntry, error) {
entries, err := fs.ReadDir(s.fsys, dir)
if err != nil {
return nil, err
}

results := make([]fs.DirEntry, 0, len(entries))
for _, entry := range entries {
filePath := filepath.Join(path, entry.Name())
filePath := path.Join(dir, entry.Name())

if entry.IsDir() {
r, err := s.ReadDir(filePath)
Expand Down