mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-21 07:08:45 +05:00
Centralize indexing in data manager
This commit is contained in:
committed by
Dan Christian Bogos
parent
6f0c06e820
commit
7bea811ca0
@@ -148,6 +148,7 @@ const CGRATES_CFG_JSON = `
|
||||
|
||||
"filters": { // Filters configuration (*new)
|
||||
"stats_conns": [], // address where to reach the stat service, empty to disable stats functionality: <""|*internal|x.y.z.y:1234>
|
||||
"indexes_selects":true,
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -707,7 +707,8 @@ func TestDfAttributeServJsonCfg(t *testing.T) {
|
||||
|
||||
func TestDfFilterSJsonCfg(t *testing.T) {
|
||||
eCfg := &FilterSJsonCfg{
|
||||
Stats_conns: &[]*HaPoolJsonCfg{},
|
||||
Stats_conns: &[]*HaPoolJsonCfg{},
|
||||
Indexes_selects: utils.BoolPointer(true),
|
||||
}
|
||||
if cfg, err := dfCgrJsonCfg.FilterSJsonCfg(); err != nil {
|
||||
t.Error(err)
|
||||
|
||||
@@ -780,7 +780,8 @@ func TestCgrCfgJSONDefaultsUserS(t *testing.T) {
|
||||
|
||||
func TestCgrCfgJSONDefaultFiltersCfg(t *testing.T) {
|
||||
eFiltersCfg := &FilterSCfg{
|
||||
StatSConns: []*HaPoolConfig{},
|
||||
StatSConns: []*HaPoolConfig{},
|
||||
IndexedSelects: true,
|
||||
}
|
||||
if !reflect.DeepEqual(cgrCfg.filterSCfg, eFiltersCfg) {
|
||||
t.Errorf("received: %+v, expecting: %+v", cgrCfg.filterSCfg, eFiltersCfg)
|
||||
|
||||
@@ -19,7 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
package config
|
||||
|
||||
type FilterSCfg struct {
|
||||
StatSConns []*HaPoolConfig
|
||||
StatSConns []*HaPoolConfig
|
||||
IndexedSelects bool
|
||||
}
|
||||
|
||||
func (fSCfg *FilterSCfg) loadFromJsonCfg(jsnCfg *FilterSJsonCfg) (err error) {
|
||||
@@ -33,5 +34,8 @@ func (fSCfg *FilterSCfg) loadFromJsonCfg(jsnCfg *FilterSJsonCfg) (err error) {
|
||||
fSCfg.StatSConns[idx].loadFromJsonCfg(jsnHaCfg)
|
||||
}
|
||||
}
|
||||
if jsnCfg.Indexes_selects != nil {
|
||||
fSCfg.IndexedSelects = *jsnCfg.Indexes_selects
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -85,7 +85,8 @@ type DbJsonCfg struct {
|
||||
|
||||
// Filters config
|
||||
type FilterSJsonCfg struct {
|
||||
Stats_conns *[]*HaPoolJsonCfg
|
||||
Stats_conns *[]*HaPoolJsonCfg
|
||||
Indexes_selects *bool
|
||||
}
|
||||
|
||||
// Rater config section
|
||||
|
||||
Reference in New Issue
Block a user