cache refactoring for save and load

This commit is contained in:
Radu Ioan Fericean
2016-06-07 22:43:02 +03:00
parent 95e8230a5c
commit e84e28faae
35 changed files with 736 additions and 605 deletions

View File

@@ -21,7 +21,6 @@ import (
"errors"
"time"
"github.com/cgrates/cgrates/cache2go"
"github.com/cgrates/cgrates/utils"
)
@@ -236,8 +235,8 @@ func (cc *CallCost) MatchCCFilter(bf *BalanceFilter) bool {
foundMatchingDestID := false
if bf.DestinationIDs != nil && cc.Destination != "" {
for _, p := range utils.SplitPrefix(cc.Destination, MIN_PREFIX_MATCH) {
if x, err := cache2go.Get(utils.DESTINATION_PREFIX + p); err == nil {
destIds := x.(map[interface{}]struct{})
if x, err := CacheGet(utils.DESTINATION_PREFIX + p); err == nil {
destIds := x.(map[string]struct{})
for filterDestID := range *bf.DestinationIDs {
if _, ok := destIds[filterDestID]; ok {
foundMatchingDestID = true