Remove duplicate consts

This commit is contained in:
TeoV
2020-12-07 11:45:59 +02:00
committed by Dan Christian Bogos
parent 77c7b983b1
commit dd48ce1057
3 changed files with 7 additions and 9 deletions

View File

@@ -194,12 +194,11 @@ func newCGRConfig(config []byte) (cfg *CGRConfig, err error) {
cfg.eesCfg = new(EEsCfg)
cfg.eesCfg.Cache = make(map[string]*CacheParamCfg)
cfg.rateSCfg = new(RateSCfg)
//cfg.actionSCfg = new(ActionSCfg)
cfg.actionSCfg = new(ActionSCfg)
cfg.sipAgentCfg = new(SIPAgentCfg)
cfg.configSCfg = new(ConfigSCfg)
cfg.apiBanCfg = new(APIBanCfg)
cfg.coreSCfg = new(CoreSCfg)
cfg.actionSCfg = new(ActionSCfg)
var cgrJSONCfg *CgrJsonCfg
if cgrJSONCfg, err = NewCgrJsonCfgFromBytes(config); err != nil {
@@ -1245,7 +1244,7 @@ func (cfg *CGRConfig) getLoadFunctions() map[string]func(*CgrJsonCfg) error {
ConfigSJson: cfg.loadConfigSCfg,
APIBanCfgJson: cfg.loadAPIBanCgrCfg,
CoreSCfgJson: cfg.loadCoreSCfg,
ActionSCfgJson: cfg.loadActionSCfg,
ActionSJson: cfg.loadActionSCfg,
}
}
@@ -1549,7 +1548,7 @@ func (cfg *CGRConfig) AsMapInterface(separator string) (mp map[string]interface{
TemplatesJson: cfg.templates.AsMapInterface(separator),
ConfigSJson: cfg.configSCfg.AsMapInterface(),
CoreSCfgJson: cfg.coreSCfg.AsMapInterface(),
ActionSCfgJson: cfg.actionSCfg.AsMapInterface(),
ActionSJson: cfg.actionSCfg.AsMapInterface(),
}
}
@@ -1699,7 +1698,7 @@ func (cfg *CGRConfig) V1GetConfig(args *SectionWithOpts, reply *map[string]inter
mp = cfg.RateSCfg().AsMapInterface()
case CoreSCfgJson:
mp = cfg.CoreSCfg().AsMapInterface()
case ActionSCfgJson:
case ActionSJson:
mp = cfg.ActionSCfg().AsMapInterface()
default:
return errors.New("Invalid section")

View File

@@ -67,7 +67,6 @@ const (
ConfigSJson = "configs"
APIBanCfgJson = "apiban"
CoreSCfgJson = "cores"
ActionSCfgJson = "actions"
)
var (
@@ -76,7 +75,7 @@ var (
KamailioAgentJSN, DA_JSN, RA_JSN, HttpAgentJson, DNSAgentJson, ATTRIBUTE_JSN, ChargerSCfgJson, RESOURCES_JSON, STATS_JSON,
THRESHOLDS_JSON, RouteSJson, LoaderJson, MAILER_JSN, SURETAX_JSON, CgrLoaderCfgJson, CgrMigratorCfgJson, DispatcherSJson,
AnalyzerCfgJson, ApierS, EEsJson, RateSJson, SIPAgentJson, DispatcherHJson, TemplatesJson, ConfigSJson, APIBanCfgJson, CoreSCfgJson,
ActionSCfgJson}
ActionSJson}
)
// Loads the json config out of io.Reader, eg other sources than file, maybe over http
@@ -588,7 +587,7 @@ func (self CgrJsonCfg) CoreSCfgJson() (*CoreSJsonCfg, error) {
}
func (self CgrJsonCfg) ActionSCfgJson() (*ActionSJsonCfg, error) {
rawCfg, hasKey := self[CoreSCfgJson]
rawCfg, hasKey := self[ActionSJson]
if !hasKey {
return nil, nil
}

File diff suppressed because one or more lines are too long