Cgr-loader now clear indexing

This commit is contained in:
TeoV
2018-06-22 11:42:27 -04:00
committed by Dan Christian Bogos
parent 05d4acab5a
commit ea2b5303f2
4 changed files with 25 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ func (chSv1 *CacheSv1) RemoveItem(args *engine.ArgsGetCacheItem,
return chSv1.cacheS.V1RemoveItem(args, reply)
}
// Clear will clear partitions in the cache (all for nil, none for empty slice)
// Clear will clear partitions in the cache (nil fol all, empty slice for none)
func (chSv1 *CacheSv1) Clear(cacheIDs []string,
reply *string) error {
return chSv1.cacheS.V1Clear(cacheIDs, reply)

View File

@@ -398,6 +398,28 @@ func main() {
}, &reply); err != nil {
log.Printf("WARNING: Got error on cache reload: %s\n", err.Error())
}
var cacheIDs []string
if len(apfIDs) != 0 {
cacheIDs = append(cacheIDs, utils.CacheSupplierFilterIndexes, utils.CacheAttributeFilterRevIndexes)
}
if len(spfIDs) != 0 {
cacheIDs = append(cacheIDs, utils.CacheAttributeFilterIndexes, utils.CacheSupplierFilterRevIndexes)
}
if len(trspfIDs) != 0 {
cacheIDs = append(cacheIDs, utils.CacheThresholdFilterIndexes, utils.CacheThresholdFilterRevIndexes)
}
if len(stqpIDs) != 0 {
cacheIDs = append(cacheIDs, utils.CacheStatFilterIndexes, utils.CacheStatFilterRevIndexes)
}
if len(rspIDs) != 0 {
cacheIDs = append(cacheIDs, utils.CacheResourceFilterIndexes, utils.CacheResourceFilterRevIndexes)
}
if *verbose {
log.Print("Clearing cached indexes")
}
if err = cacheS.Call(utils.CacheSv1Clear, cacheIDs, &reply); err != nil {
log.Printf("WARNING: Got error on cache clear: %s\n", err.Error())
}
if len(aps) != 0 {
if *verbose {

View File

@@ -2162,6 +2162,7 @@ func (tpr *TpReader) WriteToDatabase(flush, verbose, disable_reverse bool) (err
log.Print("AttributeProfiles:")
}
for _, tpTH := range tpr.attributeProfiles {
th, err := APItoAttributeProfile(tpTH, tpr.timezone)
if err != nil {
return err

View File

@@ -2044,7 +2044,7 @@ func (smg *SMGeneric) syncSessions() {
if err := conn.Call(utils.SessionSv1GetActiveSessionIDs,
"", &queriedSessionIDs); err != nil {
utils.Logger.Warning(
fmt.Sprintf("error quering session ids : %+v", err))
fmt.Sprintf("<%s> error quering session ids : %+v", utils.SessionS, err))
continue
}
for _, sessionID := range queriedSessionIDs {