mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Added some comments for index functions
This commit is contained in:
committed by
Dan Christian Bogos
parent
5a255e195a
commit
8dfdeb4522
@@ -110,7 +110,7 @@ func removeItemFromFilterIndex(dm DataManager, idxItmType, tnt, ctx, itemID stri
|
||||
for idxKey, index := range indexes {
|
||||
index.Remove(itemID)
|
||||
if index.Size() == 0 { // empty index set it with nil for cache
|
||||
indexes[idxKey] = nil
|
||||
indexes[idxKey] = nil // this will not be set in DB(handled by driver)
|
||||
}
|
||||
}
|
||||
tntCtx := tnt
|
||||
@@ -128,7 +128,7 @@ func updatedIndexes(dm DataManager, idxItmType, tnt, ctx, itemID string, oldFilt
|
||||
return
|
||||
}
|
||||
|
||||
// do not update the filters if they are the same
|
||||
// check what indexes needs to be updated
|
||||
oldFltrs := utils.NewStringSet(*oldFilterIds)
|
||||
newFltrs := utils.NewStringSet(newFilterIDs)
|
||||
|
||||
|
||||
@@ -132,17 +132,16 @@ func NewRedisStorage(address string, db int, pass, mrshlerStr string,
|
||||
sentinelInsts: sentinelInsts,
|
||||
db: db,
|
||||
pass: pass}, nil
|
||||
} else {
|
||||
p, err := pool.NewCustom(utils.TCP, address, maxConns, df)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RedisStorage{
|
||||
dbPool: p,
|
||||
maxConns: maxConns,
|
||||
ms: ms,
|
||||
}, nil
|
||||
}
|
||||
p, err := pool.NewCustom(utils.TCP, address, maxConns, df)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &RedisStorage{
|
||||
dbPool: p,
|
||||
maxConns: maxConns,
|
||||
ms: ms,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func reconnectSentinel(addr, sentinelName string, db int, pass string, maxConns int) (*sentinel.Client, error) {
|
||||
|
||||
Reference in New Issue
Block a user