Skip to content

Commit

Permalink
fix master name extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
AviAvni committed Apr 8, 2024
1 parent 8973bcc commit 7eed759
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion falkordb.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ func FalkorDBNew(options *ConnectionOption) (*FalkorDB, error) {
if len(masters.([]interface{})) != 1 {
return nil, errors.New("multiple masters, require service name")
}
masterName := masters.([]interface{})[0].(map[string]interface{})["name"].(string)
str := "name"
var strInterface interface{} = str
masterName := masters.([]interface{})[0].(map[interface{}]interface{})[strInterface].(string)
db = redis.NewFailoverClient(&redis.FailoverOptions{
MasterName: masterName,
SentinelAddrs: []string{options.Addr},
Expand Down

0 comments on commit 7eed759

Please sign in to comment.