mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated redis sentinel conection to try all conection before returning a error. closes#1410
This commit is contained in:
committed by
Dan Christian Bogos
parent
e2693f6f68
commit
396db81fa4
@@ -94,9 +94,15 @@ func NewRedisStorage(address string, db int, pass, mrshlerStr string,
|
||||
sentinelInsts[i] = &sentinelInst{addr: addr}
|
||||
if sentinelInsts[i].conn, err = sentinel.NewClientCustom("tcp",
|
||||
addr, maxConns, df, sentinelName); err != nil {
|
||||
return nil, err
|
||||
sentinelInsts[i].conn = nil
|
||||
utils.Logger.Warning(fmt.Sprintf("<RedisStorage> could not connenct to sentinel at address: %s because error: %s ",
|
||||
sentinelInsts[i].addr, err.Error()))
|
||||
// return nil, err
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RedisStorage{maxConns: maxConns, ms: mrshler,
|
||||
cacheCfg: cacheCfg, sentinelName: sentinelName,
|
||||
sentinelInsts: sentinelInsts, db: db, pass: pass}, nil
|
||||
|
||||
Reference in New Issue
Block a user