Clearing Cache when removing indexes

This commit is contained in:
porosnicuadrian
2021-05-10 09:41:20 +03:00
committed by Dan Christian Bogos
parent 18d2841670
commit 983f74f8a8
5 changed files with 36 additions and 3 deletions

View File

@@ -342,6 +342,8 @@ func TestThresholdsmatchingThresholdsForEvent(t *testing.T) {
},
},
}
dmTH.SetFilter(context.TODO(), fltrTh2, true)
dmTH.SetFilter(context.TODO(), fltrTh3, true)
for _, th := range tPrfls {
if err = dmTH.SetThresholdProfile(th, true); err != nil {
t.Errorf("Error: %+v", err)

View File

@@ -154,6 +154,7 @@ func TestFilterMatchingItemIDsForEvent2(t *testing.T) {
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
ID: "stringFilter",
Rules: stringFilter}
dmMatch.SetFilter(context.TODO(), attribStringF, true)
x, err = NewFilterRule(utils.MetaPrefix, "~*req.CallCost.Field", []string{"profile"})
if err != nil {
@@ -164,6 +165,7 @@ func TestFilterMatchingItemIDsForEvent2(t *testing.T) {
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
ID: "prefFilter",
Rules: prefixFilter}
dmMatch.SetFilter(context.TODO(), attribPrefF, true)
x, err = NewFilterRule(utils.MetaGreaterOrEqual, "~*req.Weight", []string{"200.00"})
if err != nil {
@@ -173,8 +175,9 @@ func TestFilterMatchingItemIDsForEvent2(t *testing.T) {
attribDefaultF := &Filter{
Tenant: config.CgrConfig().GeneralCfg().DefaultTenant,
ID: "defaultFilter",
Rules: defaultFilter}
Rules: defaultFilter,
}
dmMatch.SetFilter(context.TODO(), attribDefaultF, true)
tnt := config.CgrConfig().GeneralCfg().DefaultTenant
if err = addItemToFilterIndex(context.TODO(), dmMatch, utils.CacheAttributeFilterIndexes,