mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-23 16:18:44 +05:00
cache refactoring for save and load
This commit is contained in:
@@ -26,7 +26,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/cgrates/cache2go"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
)
|
||||
|
||||
@@ -196,11 +195,11 @@ func (b *Balance) Clone() *Balance {
|
||||
func (b *Balance) getMatchingPrefixAndDestID(dest string) (prefix, destId string) {
|
||||
if len(b.DestinationIDs) != 0 && b.DestinationIDs[utils.ANY] == false {
|
||||
for _, p := range utils.SplitPrefix(dest, 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 dID := range destIDs {
|
||||
if b.DestinationIDs[dID.(string)] == true {
|
||||
return p, dID.(string)
|
||||
if b.DestinationIDs[dID] == true {
|
||||
return p, dID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user