mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-24 00:28:44 +05:00
Add Filter in Cache
This commit is contained in:
committed by
Dan Christian Bogos
parent
383d0f3257
commit
ff92d3f5a4
@@ -43,7 +43,7 @@ func startRater(internalRaterChan chan rpcclient.RpcClientConnection, cacheDoneC
|
||||
waitTasks = append(waitTasks, cacheTaskChan)
|
||||
go func() {
|
||||
defer close(cacheTaskChan)
|
||||
var dstIDs, rvDstIDs, rplIDs, rpfIDs, actIDs, aplIDs, aapIDs, atrgIDs, sgIDs, lcrIDs, dcIDs, alsIDs, rvAlsIDs, rspIDs, resIDs, stqIDs, stqpIDs, thIDs, thpIDs []string
|
||||
var dstIDs, rvDstIDs, rplIDs, rpfIDs, actIDs, aplIDs, aapIDs, atrgIDs, sgIDs, lcrIDs, dcIDs, alsIDs, rvAlsIDs, rspIDs, resIDs, stqIDs, stqpIDs, thIDs, thpIDs, fltrIDs []string
|
||||
if cCfg, has := cfg.CacheConfig[utils.CacheDestinations]; !has || !cCfg.Precache {
|
||||
dstIDs = make([]string, 0) // Don't cache any
|
||||
}
|
||||
@@ -101,9 +101,12 @@ func startRater(internalRaterChan chan rpcclient.RpcClientConnection, cacheDoneC
|
||||
if cCfg, has := cfg.CacheConfig[utils.CacheThresholdProfiles]; !has || !cCfg.Precache {
|
||||
thpIDs = make([]string, 0)
|
||||
}
|
||||
if cCfg, has := cfg.CacheConfig[utils.CacheFilters]; !has || !cCfg.Precache {
|
||||
fltrIDs = make([]string, 0)
|
||||
}
|
||||
|
||||
// ToDo: Add here timings
|
||||
if err := dm.LoadDataDBCache(dstIDs, rvDstIDs, rplIDs, rpfIDs, actIDs, aplIDs, aapIDs, atrgIDs, sgIDs, lcrIDs, dcIDs, alsIDs, rvAlsIDs, rspIDs, resIDs, stqIDs, stqpIDs, thIDs, thpIDs); err != nil {
|
||||
if err := dm.LoadDataDBCache(dstIDs, rvDstIDs, rplIDs, rpfIDs, actIDs, aplIDs, aapIDs, atrgIDs, sgIDs, lcrIDs, dcIDs, alsIDs, rvAlsIDs, rspIDs, resIDs, stqIDs, stqpIDs, thIDs, thpIDs, fltrIDs); err != nil {
|
||||
utils.Logger.Crit(fmt.Sprintf("<RALs> Cache rating error: %s", err.Error()))
|
||||
exitChan <- true
|
||||
return
|
||||
|
||||
@@ -67,7 +67,7 @@ func durInternalRater(cd *engine.CallDescriptor) (time.Duration, error) {
|
||||
}
|
||||
defer dm.DataDB().Close()
|
||||
engine.SetDataStorage(dm)
|
||||
if err := dm.LoadDataDBCache(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil); err != nil {
|
||||
if err := dm.LoadDataDBCache(nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil); err != nil {
|
||||
return nilDuration, fmt.Errorf("Cache rating error: %s", err.Error())
|
||||
}
|
||||
log.Printf("Runnning %d cycles...", *runs)
|
||||
|
||||
Reference in New Issue
Block a user