mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add "ees_conns" in "apiers" section
This commit is contained in:
committed by
Dan Christian Bogos
parent
b18bbd6e8c
commit
711e628d4b
@@ -30,6 +30,7 @@ type ApierCfg struct {
|
||||
CachesConns []string // connections towards Cache
|
||||
SchedulerConns []string // connections towards Scheduler
|
||||
AttributeSConns []string // connections towards AttributeS
|
||||
EEsConns []string // connections towards EEs
|
||||
}
|
||||
|
||||
func (aCfg *ApierCfg) loadFromJsonCfg(jsnCfg *ApierJsonCfg) (err error) {
|
||||
@@ -72,6 +73,17 @@ func (aCfg *ApierCfg) loadFromJsonCfg(jsnCfg *ApierJsonCfg) (err error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if jsnCfg.Ees_conns != nil {
|
||||
aCfg.EEsConns = make([]string, len(*jsnCfg.Ees_conns))
|
||||
for idx, connID := range *jsnCfg.Ees_conns {
|
||||
// if we have the connection internal we change the name so we can have internal rpc for each subsystem
|
||||
if connID == utils.MetaInternal {
|
||||
aCfg.EEsConns[idx] = utils.ConcatenatedKey(utils.MetaInternal, utils.MetaEEs)
|
||||
} else {
|
||||
aCfg.EEsConns[idx] = connID
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -902,6 +902,7 @@ const CGRATES_CFG_JSON = `
|
||||
"caches_conns":["*internal"],
|
||||
"scheduler_conns": [], // connections to SchedulerS for reloads
|
||||
"attributes_conns": [], // connections to AttributeS for CDRExporter
|
||||
"ees_conns": [], // connections to EEs
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -1669,6 +1669,7 @@ func TestDfApierCfg(t *testing.T) {
|
||||
Caches_conns: &[]string{utils.MetaInternal},
|
||||
Scheduler_conns: &[]string{},
|
||||
Attributes_conns: &[]string{},
|
||||
Ees_conns: &[]string{},
|
||||
}
|
||||
if cfg, err := dfCgrJSONCfg.ApierCfgJson(); err != nil {
|
||||
t.Error(err)
|
||||
|
||||
@@ -1839,6 +1839,7 @@ func TestCgrCfgJSONDefaultApierCfg(t *testing.T) {
|
||||
CachesConns: []string{utils.ConcatenatedKey(utils.MetaInternal, utils.MetaCaches)},
|
||||
SchedulerConns: []string{},
|
||||
AttributeSConns: []string{},
|
||||
EEsConns: []string{},
|
||||
}
|
||||
if !reflect.DeepEqual(cgrCfg.apier, aCfg) {
|
||||
t.Errorf("received: %+v, expecting: %+v", cgrCfg.apier, aCfg)
|
||||
|
||||
@@ -608,6 +608,7 @@ type ApierJsonCfg struct {
|
||||
Caches_conns *[]string
|
||||
Scheduler_conns *[]string
|
||||
Attributes_conns *[]string
|
||||
Ees_conns *[]string
|
||||
}
|
||||
|
||||
type STIRJsonCfg struct {
|
||||
|
||||
Reference in New Issue
Block a user