From bbc34b1f778467e83565de0f3cb8d79de45ede2b Mon Sep 17 00:00:00 2001 From: Tripon Alexandru-Ionut Date: Tue, 16 Apr 2019 15:07:17 +0300 Subject: [PATCH] Removed unused InternalTtl --- cmd/cgr-engine/cgr-engine.go | 84 ++++++++---------------- cmd/cgr-engine/rater.go | 12 ++-- config/config_defaults.go | 1 - config/config_json_test.go | 1 - config/config_test.go | 3 - config/generalcfg.go | 6 -- config/generalcfg_test.go | 3 - config/libconfig_json.go | 1 - config/multifiles_it_test.go | 1 - data/conf/cgrates/cgrates.json | 1 - data/conf/samples/cgradmin/cgradmin.json | 1 - data/conf/samples/multifiles/d.json | 1 - engine/datamanager.go | 2 +- engine/filters.go | 4 +- engine/libengine.go | 2 +- loaders/loader.go | 3 +- 16 files changed, 38 insertions(+), 88 deletions(-) diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index 50b73c919..e1a694ee5 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -136,7 +136,7 @@ func startCdrc(internalCdrSChan, internalRaterChan chan rpcclient.RpcClientConne cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cdrcCfg.CdrsConns, internalCdrSChan, cfg.GeneralCfg().InternalTtl, false) + cdrcCfg.CdrsConns, internalCdrSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to CDRS via RPC: %s", err.Error())) exitChan <- true @@ -177,7 +177,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, cfg.SessionSCfg().ChargerSConns, - internalChargerSChan, cfg.GeneralCfg().InternalTtl, false) + internalChargerSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.SessionS, utils.ChargerS, err.Error())) @@ -193,7 +193,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, cfg.SessionSCfg().RALsConns, - internalRaterChan, cfg.GeneralCfg().InternalTtl, false) + internalRaterChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to RALs: %s", utils.SessionS, err.Error())) @@ -209,8 +209,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().ResSConns, internalResourceSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().ResSConns, internalResourceSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to ResourceS: %s", utils.SessionS, err.Error())) @@ -226,8 +225,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().ThreshSConns, internalThresholdSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().ThreshSConns, internalThresholdSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to ThresholdS: %s", utils.SessionS, err.Error())) @@ -243,8 +241,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().StatSConns, internalStatSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().StatSConns, internalStatSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to StatS: %s", utils.SessionS, err.Error())) @@ -260,8 +257,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().SupplSConns, internalSupplierSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().SupplSConns, internalSupplierSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to SupplierS: %s", utils.SessionS, err.Error())) @@ -277,8 +273,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().AttrSConns, internalAttrSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().AttrSConns, internalAttrSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to AttributeS: %s", utils.SessionS, err.Error())) @@ -294,8 +289,7 @@ func startSessionS(internalSMGChan, internalRaterChan, internalResourceSChan, in cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SessionSCfg().CDRsConns, internalCDRSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SessionSCfg().CDRsConns, internalCDRSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to RALs: %s", utils.SessionS, err.Error())) @@ -369,8 +363,7 @@ func startAsteriskAgent(internalSMGChan, internalDispatcherSChan chan rpcclient. cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.AsteriskAgentCfg().SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.AsteriskAgentCfg().SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.AsteriskAgent, utils.SessionS, err.Error())) @@ -435,8 +428,7 @@ func startDiameterAgent(internalSsChan, internalDispatcherSChan chan rpcclient.R cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.DiameterAgentCfg().SessionSConns, internalSsChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.DiameterAgentCfg().SessionSConns, internalSsChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.DiameterAgent, utils.SessionS, err.Error())) @@ -484,8 +476,7 @@ func startRadiusAgent(internalSMGChan, internalDispatcherSChan chan rpcclient.Rp cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.RadiusAgentCfg().SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.RadiusAgentCfg().SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to SMG: %s", utils.RadiusAgent, err.Error())) exitChan <- true @@ -538,8 +529,7 @@ func startDNSAgent(internalSMGChan, internalDispatcherSChan chan rpcclient.RpcCl cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.DNSAgentCfg().SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.DNSAgentCfg().SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.DNSAgent, utils.SessionS, err.Error())) @@ -595,8 +585,7 @@ func startFsAgent(internalSMGChan, internalDispatcherSChan chan rpcclient.RpcCli cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.FsAgentCfg().SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.FsAgentCfg().SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.FreeSWITCHAgent, utils.SessionS, err.Error())) @@ -648,8 +637,7 @@ func startKamAgent(internalSMGChan, internalDispatcherSChan chan rpcclient.RpcCl cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.KamAgentCfg().SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.KamAgentCfg().SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.KamailioAgent, utils.SessionS, err.Error())) @@ -694,8 +682,7 @@ func startHTTPAgent(internalSMGChan, internalDispatcherSChan chan rpcclient.RpcC cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - agntCfg.SessionSConns, internalSMGChan, - cfg.GeneralCfg().InternalTtl, false) + agntCfg.SessionSConns, internalSMGChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> could not connect to %s, error: %s", utils.HTTPAgent, utils.SessionS, err.Error())) @@ -731,8 +718,7 @@ func startCDRS(internalCdrSChan, internalRaterChan, internalAttributeSChan, inte cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.CdrsCfg().CDRSChargerSConns, internalChargerSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.CdrsCfg().CDRSChargerSConns, internalChargerSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to %s: %s", utils.ChargerS, err.Error())) @@ -748,8 +734,7 @@ func startCDRS(internalCdrSChan, internalRaterChan, internalAttributeSChan, inte cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.CdrsCfg().CDRSRaterConns, internalRaterChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.CdrsCfg().CDRSRaterConns, internalRaterChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to RAL: %s", err.Error())) exitChan <- true @@ -764,8 +749,7 @@ func startCDRS(internalCdrSChan, internalRaterChan, internalAttributeSChan, inte cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.CdrsCfg().CDRSAttributeSConns, internalAttributeSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.CdrsCfg().CDRSAttributeSConns, internalAttributeSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to %s: %s", utils.AttributeS, err.Error())) @@ -781,8 +765,7 @@ func startCDRS(internalCdrSChan, internalRaterChan, internalAttributeSChan, inte cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.CdrsCfg().CDRSThresholdSConns, internalThresholdSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.CdrsCfg().CDRSThresholdSConns, internalThresholdSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to ThresholdS: %s", err.Error())) exitChan <- true @@ -797,8 +780,7 @@ func startCDRS(internalCdrSChan, internalRaterChan, internalAttributeSChan, inte cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.CdrsCfg().CDRSStatSConns, internalStatSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.CdrsCfg().CDRSStatSConns, internalStatSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to StatS: %s", err.Error())) exitChan <- true @@ -889,8 +871,7 @@ func startChargerService(internalChargerSChan, internalAttributeSChan, cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.ChargerSCfg().AttributeSConns, internalAttributeSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.ChargerSCfg().AttributeSConns, internalAttributeSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.ChargerS, utils.AttributeS, err.Error())) @@ -941,8 +922,7 @@ func startResourceService(internalRsChan, internalThresholdSChan, cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.ResourceSCfg().ThresholdSConns, internalThresholdSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.ResourceSCfg().ThresholdSConns, internalThresholdSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to ThresholdS: %s", err.Error())) exitChan <- true @@ -996,8 +976,7 @@ func startStatService(internalStatSChan, internalThresholdSChan, cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.StatSCfg().ThresholdSConns, internalThresholdSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.StatSCfg().ThresholdSConns, internalThresholdSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to ThresholdS: %s", err.Error())) exitChan <- true @@ -1086,8 +1065,7 @@ func startSupplierService(internalSupplierSChan, internalRsChan, internalStatSCh cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SupplierSCfg().AttributeSConns, internalAttrSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SupplierSCfg().AttributeSConns, internalAttrSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.SupplierS, utils.AttributeS, err.Error())) @@ -1103,8 +1081,7 @@ func startSupplierService(internalSupplierSChan, internalRsChan, internalStatSCh cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SupplierSCfg().StatSConns, internalStatSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SupplierSCfg().StatSConns, internalStatSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to StatS: %s", utils.SupplierS, err.Error())) @@ -1120,8 +1097,7 @@ func startSupplierService(internalSupplierSChan, internalRsChan, internalStatSCh cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SupplierSCfg().ResourceSConns, internalRsChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SupplierSCfg().ResourceSConns, internalRsChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to StatS: %s", utils.SupplierS, err.Error())) @@ -1202,8 +1178,7 @@ func startDispatcherService(internalDispatcherSChan, internalAttributeSChan chan cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.DispatcherSCfg().AttributeSConns, internalAttributeSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.DispatcherSCfg().AttributeSConns, internalAttributeSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to %s: %s", utils.DispatcherS, utils.AttributeS, err.Error())) @@ -1465,8 +1440,7 @@ func schedCDRsConns(internalCDRSChan, internalDispatcherSChan chan rpcclient.Rpc cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.SchedulerCfg().CDRsConns, internalCDRSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.SchedulerCfg().CDRsConns, internalCDRSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf("<%s> Could not connect to CDRServer: %s", utils.SchedulerS, err.Error())) exitChan <- true diff --git a/cmd/cgr-engine/rater.go b/cmd/cgr-engine/rater.go index 057f013e3..4430baaaa 100755 --- a/cmd/cgr-engine/rater.go +++ b/cmd/cgr-engine/rater.go @@ -77,8 +77,7 @@ func startRater(internalRaterChan, internalApierv1, internalApierv2, internalThd cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.RalsCfg().RALsThresholdSConns, internalThdSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.RalsCfg().RALsThresholdSConns, internalThdSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to ThresholdS, error: %s", err.Error())) exitChan <- true @@ -101,8 +100,7 @@ func startRater(internalRaterChan, internalApierv1, internalApierv2, internalThd cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.RalsCfg().RALsStatSConns, internalStatSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.RalsCfg().RALsStatSConns, internalStatSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to StatS, error: %s", err.Error())) exitChan <- true @@ -126,8 +124,7 @@ func startRater(internalRaterChan, internalApierv1, internalApierv2, internalThd cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.ApierCfg().CachesConns, internalCacheSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.ApierCfg().CachesConns, internalCacheSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to CacheS, error: %s", err.Error())) exitChan <- true @@ -151,8 +148,7 @@ func startRater(internalRaterChan, internalApierv1, internalApierv2, internalThd cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - cfg.ApierCfg().SchedulerConns, internalSchedulerSChan, - cfg.GeneralCfg().InternalTtl, false) + cfg.ApierCfg().SchedulerConns, internalSchedulerSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to SchedulerS, error: %s", err.Error())) exitChan <- true diff --git a/config/config_defaults.go b/config/config_defaults.go index ccb75a2a9..5b680fb53 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -46,7 +46,6 @@ const CGRATES_CFG_JSON = ` "reconnects": -1, // number of retries in case of connection lost "connect_timeout": "1s", // consider connection unsuccessful on timeout, 0 to disable the feature "reply_timeout": "2s", // consider connection down for replies taking longer than this value - "internal_ttl": "5s", // maximum duration to wait for internal connections before giving up "locking_timeout": "0", // timeout internal locks to avoid deadlocks "digest_separator": ",", // separator to use in replies containing data digests "digest_equal": ":", // equal symbol used in case of digests diff --git a/config/config_json_test.go b/config/config_json_test.go index 04df53730..d02f6b4da 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -56,7 +56,6 @@ func TestDfGeneralJsonCfg(t *testing.T) { Reconnects: utils.IntPointer(-1), Connect_timeout: utils.StringPointer("1s"), Reply_timeout: utils.StringPointer("2s"), - Internal_ttl: utils.StringPointer("5s"), Locking_timeout: utils.StringPointer("0"), Digest_separator: utils.StringPointer(","), Digest_equal: utils.StringPointer(":"), diff --git a/config/config_test.go b/config/config_test.go index c64174f9a..61f2ceb14 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -364,9 +364,6 @@ func TestCgrCfgJSONDefaultsGeneral(t *testing.T) { if cgrCfg.GeneralCfg().ReplyTimeout != 2*time.Second { t.Errorf("Expected: 2s, received: %+v", cgrCfg.GeneralCfg().ReplyTimeout) } - if cgrCfg.GeneralCfg().InternalTtl != 5*time.Second { - t.Errorf("Expected: 2m, received: %+v", cgrCfg.GeneralCfg().InternalTtl) - } if cgrCfg.GeneralCfg().LockingTimeout != 0 { t.Errorf("Expected: 0, received: %+v", cgrCfg.GeneralCfg().LockingTimeout) } diff --git a/config/generalcfg.go b/config/generalcfg.go index 60394706d..b1903cb8e 100644 --- a/config/generalcfg.go +++ b/config/generalcfg.go @@ -45,7 +45,6 @@ type GeneralCfg struct { Reconnects int // number of recconect attempts in case of connection lost <-1 for infinite | nb> ConnectTimeout time.Duration // timeout for RPC connection attempts ReplyTimeout time.Duration // timeout replies if not reaching back - InternalTtl time.Duration // maximum duration to wait for internal connections before giving up LockingTimeout time.Duration // locking mechanism timeout to avoid deadlocks DigestSeparator string // DigestEqual string // @@ -116,11 +115,6 @@ func (gencfg *GeneralCfg) loadFromJsonCfg(jsnGeneralCfg *GeneralJsonCfg) (err er if jsnGeneralCfg.Default_caching != nil { gencfg.DefaultCaching = *jsnGeneralCfg.Default_caching } - if jsnGeneralCfg.Internal_ttl != nil { - if gencfg.InternalTtl, err = utils.ParseDurationWithNanosecs(*jsnGeneralCfg.Internal_ttl); err != nil { - return err - } - } if jsnGeneralCfg.Locking_timeout != nil { if gencfg.LockingTimeout, err = utils.ParseDurationWithNanosecs(*jsnGeneralCfg.Locking_timeout); err != nil { return err diff --git a/config/generalcfg_test.go b/config/generalcfg_test.go index 002aef6cf..37a0d520f 100644 --- a/config/generalcfg_test.go +++ b/config/generalcfg_test.go @@ -56,7 +56,6 @@ func TestGeneralCfgloadFromJsonCfg(t *testing.T) { "connect_timeout": "1s", // consider connection unsuccessful on timeout, 0 to disable the feature "reply_timeout": "2s", // consider connection down for replies taking longer than this value "response_cache_ttl": "0s", // the life span of a cached response - "internal_ttl": "2m", // maximum duration to wait for internal connections before giving up "locking_timeout": "0", // timeout internal locks to avoid deadlocks "digest_separator": ",", "digest_equal": ":", @@ -80,8 +79,6 @@ func TestGeneralCfgloadFromJsonCfg(t *testing.T) { Reconnects: -1, ConnectTimeout: time.Duration(1 * time.Second), ReplyTimeout: time.Duration(2 * time.Second), - InternalTtl: time.Duration(2 * time.Minute), - LockingTimeout: time.Duration(0), DigestSeparator: ",", DigestEqual: ":", } diff --git a/config/libconfig_json.go b/config/libconfig_json.go index b5b06a9e8..77aa5bffc 100755 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -38,7 +38,6 @@ type GeneralJsonCfg struct { Reconnects *int Connect_timeout *string Reply_timeout *string - Internal_ttl *string Locking_timeout *string Digest_separator *string Digest_equal *string diff --git a/config/multifiles_it_test.go b/config/multifiles_it_test.go index 026d91946..01241f6d3 100644 --- a/config/multifiles_it_test.go +++ b/config/multifiles_it_test.go @@ -117,7 +117,6 @@ func TestMfEnvReaderITRead(t *testing.T) { Reconnects: -1, ConnectTimeout: time.Duration(1 * time.Second), ReplyTimeout: time.Duration(2 * time.Second), - InternalTtl: time.Duration(2 * time.Minute), LockingTimeout: time.Duration(0), DigestSeparator: ",", DigestEqual: ":", diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 40c57cf7d..0d828794d 100644 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -24,7 +24,6 @@ // "reconnects": -1, // number of retries in case of connection lost // "connect_timeout": "1s", // consider connection unsuccessful on timeout, 0 to disable the feature // "reply_timeout": "2s", // consider connection down for replies taking longer than this value -// "internal_ttl": "5s", // maximum duration to wait for internal connections before giving up // "locking_timeout": "0", // timeout internal locks to avoid deadlocks // "digest_separator": ",", // separator to use in replies containing data digests // "digest_equal": ":", // equal symbol used in case of digests diff --git a/data/conf/samples/cgradmin/cgradmin.json b/data/conf/samples/cgradmin/cgradmin.json index 80d5cd375..593043c15 100644 --- a/data/conf/samples/cgradmin/cgradmin.json +++ b/data/conf/samples/cgradmin/cgradmin.json @@ -5,7 +5,6 @@ // Starts rater, scheduler "general": { - "internal_ttl": "30m", }, "listen": { diff --git a/data/conf/samples/multifiles/d.json b/data/conf/samples/multifiles/d.json index 3adfb8c1d..ee0f61da1 100644 --- a/data/conf/samples/multifiles/d.json +++ b/data/conf/samples/multifiles/d.json @@ -20,7 +20,6 @@ "connect_timeout": "1s", // consider connection unsuccessful on timeout, 0 to disable the feature "reply_timeout": "2s", // consider connection down for replies taking longer than this value "response_cache_ttl": "0s", // the life span of a cached response - "internal_ttl": "2m", // maximum duration to wait for internal connections before giving up "locking_timeout": "0", // timeout internal locks to avoid deadlocks "digest_separator": ",", "digest_equal": ":", diff --git a/engine/datamanager.go b/engine/datamanager.go index d64b112cf..4a32c24b2 100644 --- a/engine/datamanager.go +++ b/engine/datamanager.go @@ -1334,7 +1334,7 @@ func (dm *DataManager) GetDispatcherHost(tenant, id string, cacheRead, cacheWrit cfg.TlsCfg().ClientCerificate, cfg.TlsCfg().CaCertificate, cfg.GeneralCfg().ConnectAttempts, cfg.GeneralCfg().Reconnects, cfg.GeneralCfg().ConnectTimeout, cfg.GeneralCfg().ReplyTimeout, - dH.Conns, IntRPC.GetInternalChanel(), cfg.GeneralCfg().InternalTtl, false); err != nil { + dH.Conns, IntRPC.GetInternalChanel(), false); err != nil { return nil, err } Cache.Set(utils.CacheDispatcherHosts, tntID, dH, nil, diff --git a/engine/filters.go b/engine/filters.go index 2eb2bdbc4..9897a20a4 100644 --- a/engine/filters.go +++ b/engine/filters.go @@ -95,7 +95,7 @@ func (fS *FilterS) connStatS(statSChan chan rpcclient.RpcClientConnection) (err fS.cfg.TlsCfg().CaCertificate, fS.cfg.GeneralCfg().ConnectAttempts, fS.cfg.GeneralCfg().Reconnects, fS.cfg.GeneralCfg().ConnectTimeout, fS.cfg.GeneralCfg().ReplyTimeout, fS.cfg.FilterSCfg().StatSConns, - statSChan, fS.cfg.GeneralCfg().InternalTtl, true) + statSChan, true) return } @@ -111,7 +111,7 @@ func (fS *FilterS) connResourceS(resSChan chan rpcclient.RpcClientConnection) (e fS.cfg.TlsCfg().CaCertificate, fS.cfg.GeneralCfg().ConnectAttempts, fS.cfg.GeneralCfg().Reconnects, fS.cfg.GeneralCfg().ConnectTimeout, fS.cfg.GeneralCfg().ReplyTimeout, fS.cfg.FilterSCfg().ResourceSConns, - resSChan, fS.cfg.GeneralCfg().InternalTtl, true) + resSChan, true) return } diff --git a/engine/libengine.go b/engine/libengine.go index ac979a51a..8c0bb85d2 100644 --- a/engine/libengine.go +++ b/engine/libengine.go @@ -30,7 +30,7 @@ import ( func NewRPCPool(dispatchStrategy string, keyPath, certPath, caPath string, connAttempts, reconnects int, connectTimeout, replyTimeout time.Duration, rpcConnCfgs []*config.RemoteHost, - internalConnChan chan rpcclient.RpcClientConnection, ttl time.Duration, lazyConnect bool) (*rpcclient.RpcClientPool, error) { + internalConnChan chan rpcclient.RpcClientConnection, lazyConnect bool) (*rpcclient.RpcClientPool, error) { var rpcClient *rpcclient.RpcClient var err error rpcPool := rpcclient.NewRpcClientPool(dispatchStrategy, replyTimeout) diff --git a/loaders/loader.go b/loaders/loader.go index 4a2120460..ba258eb1c 100644 --- a/loaders/loader.go +++ b/loaders/loader.go @@ -82,8 +82,7 @@ func NewLoader(dm *engine.DataManager, cfg *config.LoaderSCfg, config.CgrConfig().TlsCfg().ClientCerificate, config.CgrConfig().TlsCfg().CaCertificate, config.CgrConfig().GeneralCfg().ConnectAttempts, config.CgrConfig().GeneralCfg().Reconnects, config.CgrConfig().GeneralCfg().ConnectTimeout, config.CgrConfig().GeneralCfg().ReplyTimeout, - cfg.CacheSConns, internalCacheSChan, - config.CgrConfig().GeneralCfg().InternalTtl, false) + cfg.CacheSConns, internalCacheSChan, false) if err != nil { utils.Logger.Crit(fmt.Sprintf(" Could not connect to CacheS, error: %s", err.Error())) exitChan <- true