EENoLksCfg for a configuration without locks

This commit is contained in:
DanB
2020-05-10 21:30:38 +02:00
parent 75b9433ccc
commit e29541f5b2
2 changed files with 9 additions and 2 deletions

View File

@@ -980,6 +980,13 @@ func (cfg *CGRConfig) ERsCfg() *ERsCfg {
// EEsCfg reads the EventExporter configuration
func (cfg *CGRConfig) EEsCfg() *EEsCfg {
cfg.lks[EEsJson].RLock()
defer cfg.lks[EEsJson].RUnlock()
return cfg.eesCfg
}
// EEsCfg reads the EventExporter configuration
func (cfg *CGRConfig) EEsNoLksCfg() *EEsCfg {
return cfg.eesCfg
}

View File

@@ -113,7 +113,7 @@ func (eeS *EventExporterS) attrSProcessEvent(cgrEv *utils.CGREventWithOpts, attr
ArgDispatcher: cgrEv.ArgDispatcher,
}
if err = eeS.connMgr.Call(
eeS.cfg.EEsCfg().AttributeSConns, nil,
eeS.cfg.EEsNoLksCfg().AttributeSConns, nil,
utils.AttributeSv1ProcessEvent,
attrArgs, &rplyEv); err == nil && len(rplyEv.AlteredFields) != 0 {
cgrEv.CGREvent = rplyEv.CGREvent
@@ -132,7 +132,7 @@ func (eeS *EventExporterS) V1ProcessEvent(cgrEv *utils.CGREventWithOpts, rply *s
var wg sync.WaitGroup
var withErr bool
for cfgIdx, eeCfg := range eeS.cfg.EEsCfg().Exporters {
for cfgIdx, eeCfg := range eeS.cfg.EEsNoLksCfg().Exporters {
if len(eeCfg.Filters) != 0 {
cgrDp := config.NewNavigableMap(map[string]interface{}{