Moving cache for Filter and update cgr-console

This commit is contained in:
TeoV
2019-03-25 12:20:37 +02:00
committed by Dan Christian Bogos
parent 3ac9852e2f
commit ecdfda51ae
11 changed files with 448 additions and 382 deletions

View File

@@ -381,19 +381,12 @@ func (dm *DataManager) GetFilter(tenant, id string, cacheRead, cacheWrite bool,
}
func (dm *DataManager) SetFilter(fltr *Filter) (err error) {
if err = dm.DataDB().SetFilterDrv(fltr); err != nil {
return
}
return dm.CacheDataFromDB(utils.FilterPrefix, []string{fltr.TenantID()}, true)
return dm.DataDB().SetFilterDrv(fltr)
}
func (dm *DataManager) RemoveFilter(tenant, id, transactionID string) (err error) {
if err = dm.DataDB().RemoveFilterDrv(tenant, id); err != nil {
return
}
Cache.Remove(utils.CacheFilters, utils.ConcatenatedKey(tenant, id),
cacheCommit(transactionID), transactionID)
return
return dm.DataDB().RemoveFilterDrv(tenant, id)
}
func (dm *DataManager) GetThreshold(tenant, id string,

View File

@@ -1157,7 +1157,6 @@ func testOnStorITResourceProfile(t *testing.T) {
t.Error(err)
} else if !reflect.DeepEqual(rL, rcv) {
t.Errorf("Expecting: %v, received: %v", utils.ToJSON(rL), utils.ToJSON(rcv))
}
expectedR := []string{"rsp_cgrates.org:RL_TEST2"}
if itm, err := onStor.DataDB().GetKeysForPrefix(utils.ResourceProfilesPrefix); err != nil {