mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 14:19:54 +05:00
Diameter fix for config loading in case of pubsubs
This commit is contained in:
@@ -460,7 +460,7 @@ func TestDiameterAgentJsonCfg(t *testing.T) {
|
||||
&HaPoolJsonCfg{
|
||||
Address: utils.StringPointer(utils.MetaInternal),
|
||||
}},
|
||||
Pubsub_conns: nil,
|
||||
Pubsubs_conns: &[]*HaPoolJsonCfg{},
|
||||
Create_cdr: utils.BoolPointer(true),
|
||||
Debit_interval: utils.StringPointer("5m"),
|
||||
Timezone: utils.StringPointer(""),
|
||||
|
||||
@@ -61,9 +61,9 @@ func (self *DiameterAgentCfg) loadFromJsonCfg(jsnCfg *DiameterAgentJsonCfg) erro
|
||||
self.SMGenericConns[idx].loadFromJsonCfg(jsnHaCfg)
|
||||
}
|
||||
}
|
||||
if jsnCfg.Pubsub_conns != nil {
|
||||
self.PubSubConns = make([]*HaPoolConfig, len(*jsnCfg.Pubsub_conns))
|
||||
for idx, jsnHaCfg := range *jsnCfg.Pubsub_conns {
|
||||
if jsnCfg.Pubsubs_conns != nil {
|
||||
self.PubSubConns = make([]*HaPoolConfig, len(*jsnCfg.Pubsubs_conns))
|
||||
for idx, jsnHaCfg := range *jsnCfg.Pubsubs_conns {
|
||||
self.PubSubConns[idx] = NewDfltHaPoolConfig()
|
||||
self.PubSubConns[idx].loadFromJsonCfg(jsnHaCfg)
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ type DiameterAgentJsonCfg struct {
|
||||
Listen *string // address where to listen for diameter requests <x.y.z.y:1234>
|
||||
Dictionaries_dir *string // path towards additional dictionaries
|
||||
Sm_generic_conns *[]*HaPoolJsonCfg // Connections towards generic SM
|
||||
Pubsub_conns *[]*HaPoolJsonCfg // connection towards pubsubs
|
||||
Pubsubs_conns *[]*HaPoolJsonCfg // connection towards pubsubs
|
||||
Create_cdr *bool
|
||||
Debit_interval *string
|
||||
Timezone *string // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB>
|
||||
|
||||
@@ -243,7 +243,6 @@ func (self *CdrServer) deriveRateStoreStatsReplicate(cdr *CDR, store, stats, rep
|
||||
}
|
||||
var ratedCDRs []*CDR // Gather all CDRs received from rating subsystem
|
||||
for _, cdrRun := range cdrRuns {
|
||||
utils.Logger.Debug(fmt.Sprintf("Processing CDR run: %+v", cdrRun))
|
||||
if err := LoadUserProfile(cdrRun, utils.EXTRA_FIELDS); err != nil {
|
||||
utils.Logger.Err(fmt.Sprintf("<CDRS> UserS handling for CDR %+v, got error: %s", cdrRun, err.Error()))
|
||||
continue
|
||||
|
||||
@@ -289,7 +289,6 @@ func (s *Stats) setupQueueSaver(sq *StatsQueue) {
|
||||
func (s *Stats) AppendCDR(cdr *CDR, out *int) error {
|
||||
s.mux.RLock()
|
||||
defer s.mux.RUnlock()
|
||||
utils.Logger.Debug(fmt.Sprintf("Stats.AppendCDR: %+v", cdr))
|
||||
for _, sq := range s.queues {
|
||||
sq.AppendCDR(cdr)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user