diff --git a/cmd/cgr-engine/cgr-engine.go b/cmd/cgr-engine/cgr-engine.go index 88d41988a..f53540554 100644 --- a/cmd/cgr-engine/cgr-engine.go +++ b/cmd/cgr-engine/cgr-engine.go @@ -1062,7 +1062,6 @@ func startRpc(server *utils.Server, internalRaterChan, ) } } - } func writePid() { @@ -1231,8 +1230,7 @@ func main() { if cfg.RALsEnabled { go startRater(internalRaterChan, cacheS, internalThresholdSChan, internalCdrStatSChan, internalStatSChan, - internalPubSubSChan, internalAttributeSChan, - internalUserSChan, internalAliaseSChan, + internalPubSubSChan, internalUserSChan, internalAliaseSChan, srvManager, server, dm, loadDb, cdrDb, &stopHandled, exitChan) } diff --git a/cmd/cgr-engine/rater.go b/cmd/cgr-engine/rater.go index 9b600169d..02118a5dd 100755 --- a/cmd/cgr-engine/rater.go +++ b/cmd/cgr-engine/rater.go @@ -32,7 +32,7 @@ import ( // Starts rater and reports on chan func startRater(internalRaterChan chan rpcclient.RpcClientConnection, cacheS *engine.CacheS, internalThdSChan, internalCdrStatSChan, internalStatSChan, internalPubSubSChan, - internalAttributeSChan, internalUserSChan, internalAliaseSChan chan rpcclient.RpcClientConnection, + internalUserSChan, internalAliaseSChan chan rpcclient.RpcClientConnection, serviceManager *servmanager.ServiceManager, server *utils.Server, dm *engine.DataManager, loadDb engine.LoadStorage, cdrDb engine.CdrStorage, stopHandled *bool, exitChan chan bool) { var waitTasks []chan struct{} @@ -126,25 +126,6 @@ func startRater(internalRaterChan chan rpcclient.RpcClientConnection, cacheS *en }() } - var attrS *rpcclient.RpcClientPool - if len(cfg.RALsAttributeSConns) != 0 { // Connections to AttributeS - attrsTaskChan := make(chan struct{}) - waitTasks = append(waitTasks, attrsTaskChan) - go func() { - defer close(attrsTaskChan) - var err error - attrS, err = engine.NewRPCPool(rpcclient.POOL_FIRST, cfg.TLSClientKey, cfg.TLSClientCerificate, cfg.ConnectAttempts, - cfg.Reconnects, cfg.ConnectTimeout, cfg.ReplyTimeout, - cfg.RALsAttributeSConns, internalAttributeSChan, cfg.InternalTtl) - if err != nil { - utils.Logger.Crit(fmt.Sprintf(" Could not connect to %s, error: %s", - utils.AttributeS, err.Error())) - exitChan <- true - return - } - }() - } - if len(cfg.RALsAliasSConns) != 0 { // Connection to AliasService aliasesTaskChan := make(chan struct{}) waitTasks = append(waitTasks, aliasesTaskChan) @@ -192,9 +173,6 @@ func startRater(internalRaterChan chan rpcclient.RpcClientConnection, cacheS *en if thdS != nil { engine.SetThresholdS(thdS) // temporary architectural fix until we will have separate AccountS } - if attrS != nil { - responder.AttributeS = attrS - } if cdrStats != nil { // ToDo: Fix here properly the init of stats responder.CdrStats = cdrStats apierRpcV1.CdrStatsSrv = cdrStats diff --git a/config/config.go b/config/config.go index 935b87bc2..b63acd075 100755 --- a/config/config.go +++ b/config/config.go @@ -315,7 +315,6 @@ type CGRConfig struct { RALsCDRStatSConns []*HaPoolConfig // address where to reach the cdrstats service. Empty to disable stats gathering <""|internal|x.y.z.y:1234> RALsStatSConns []*HaPoolConfig RALsPubSubSConns []*HaPoolConfig - RALsAttributeSConns []*HaPoolConfig RALsUserSConns []*HaPoolConfig RALsAliasSConns []*HaPoolConfig RpSubjectPrefixMatching bool // enables prefix matching for the rating profile subject @@ -399,12 +398,6 @@ func (self *CGRConfig) checkConfigSanity() error { return errors.New("Alias server not enabled but requested by RALs component.") } } - - for _, connCfg := range self.RALsAttributeSConns { - if connCfg.Address == utils.MetaInternal && !self.attributeSCfg.Enabled { - return errors.New("Attribute service not enabled but requested by RALs component.") - } - } for _, connCfg := range self.RALsUserSConns { if connCfg.Address == utils.MetaInternal && !self.UserServerEnabled { return errors.New("User service not enabled but requested by RALs component.") @@ -1142,14 +1135,6 @@ func (self *CGRConfig) loadFromJsonCfg(jsnCfg *CgrJsonCfg) (err error) { self.RALsPubSubSConns[idx].loadFromJsonCfg(jsnHaCfg) } } - - if jsnRALsCfg.Attributes_conns != nil { - self.RALsAttributeSConns = make([]*HaPoolConfig, len(*jsnRALsCfg.Attributes_conns)) - for idx, jsnHaCfg := range *jsnRALsCfg.Attributes_conns { - self.RALsAttributeSConns[idx] = NewDfltHaPoolConfig() - self.RALsAttributeSConns[idx].loadFromJsonCfg(jsnHaCfg) - } - } if jsnRALsCfg.Aliases_conns != nil { self.RALsAliasSConns = make([]*HaPoolConfig, len(*jsnRALsCfg.Aliases_conns)) for idx, jsnHaCfg := range *jsnRALsCfg.Aliases_conns { diff --git a/config/config_defaults.go b/config/config_defaults.go index 9fa50985a..d3494ffc2 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -161,7 +161,6 @@ const CGRATES_CFG_JSON = ` "cdrstats_conns": [], // address where to reach the cdrstats service, empty to disable stats functionality: <""|*internal|x.y.z.y:1234> "stats_conns": [], // address where to reach the stat service, empty to disable stats functionality: <""|*internal|x.y.z.y:1234> "pubsubs_conns": [], // address where to reach the pubusb service, empty to disable pubsub functionality: <""|*internal|x.y.z.y:1234> - "attributes_conns": [], // address where to reach the attribute service, empty to disable attributes functionality: <""|*internal|x.y.z.y:1234> "users_conns": [], // address where to reach the user service, empty to disable user profile functionality: <""|*internal|x.y.z.y:1234> "aliases_conns": [], // address where to reach the aliases service, empty to disable aliases functionality: <""|*internal|x.y.z.y:1234> "rp_subject_prefix_matching": false, // enables prefix matching for the rating profile subject diff --git a/config/config_json_test.go b/config/config_json_test.go index ccf659855..bb06afbd1 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -244,7 +244,6 @@ func TestDfRalsJsonCfg(t *testing.T) { Cdrstats_conns: &[]*HaPoolJsonCfg{}, Stats_conns: &[]*HaPoolJsonCfg{}, Pubsubs_conns: &[]*HaPoolJsonCfg{}, - Attributes_conns: &[]*HaPoolJsonCfg{}, Users_conns: &[]*HaPoolJsonCfg{}, Aliases_conns: &[]*HaPoolJsonCfg{}, Rp_subject_prefix_matching: utils.BoolPointer(false), diff --git a/config/config_test.go b/config/config_test.go index 3e399cea5..2fbbb1539 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -453,9 +453,6 @@ func TestCgrCfgJSONDefaultsRALs(t *testing.T) { if !reflect.DeepEqual(cgrCfg.RALsPubSubSConns, eHaPoolcfg) { t.Error(cgrCfg.RALsPubSubSConns) } - if !reflect.DeepEqual(cgrCfg.RALsAttributeSConns, eHaPoolcfg) { - t.Error(cgrCfg.RALsAttributeSConns) - } if !reflect.DeepEqual(cgrCfg.RALsUserSConns, eHaPoolcfg) { t.Error(cgrCfg.RALsUserSConns) } diff --git a/config/libconfig_json.go b/config/libconfig_json.go index ec8acc076..193a9d135 100755 --- a/config/libconfig_json.go +++ b/config/libconfig_json.go @@ -96,7 +96,6 @@ type RalsJsonCfg struct { Cdrstats_conns *[]*HaPoolJsonCfg Stats_conns *[]*HaPoolJsonCfg Pubsubs_conns *[]*HaPoolJsonCfg - Attributes_conns *[]*HaPoolJsonCfg Aliases_conns *[]*HaPoolJsonCfg Users_conns *[]*HaPoolJsonCfg Rp_subject_prefix_matching *bool diff --git a/data/storage/mysql/create_tariffplan_tables.sql b/data/storage/mysql/create_tariffplan_tables.sql index f6e3fc8c4..957c119f4 100644 --- a/data/storage/mysql/create_tariffplan_tables.sql +++ b/data/storage/mysql/create_tariffplan_tables.sql @@ -538,6 +538,7 @@ CREATE TABLE tp_attributes ( `initial` varchar(64) NOT NULL, `substitute` varchar(64) NOT NULL, `append` BOOLEAN NOT NULL, + `blocker` BOOLEAN NOT NULL, `weight` decimal(8,2) NOT NULL, `created_at` TIMESTAMP, PRIMARY KEY (`pk`), diff --git a/data/storage/postgres/create_tariffplan_tables.sql b/data/storage/postgres/create_tariffplan_tables.sql index bcb5f2c04..419570f20 100644 --- a/data/storage/postgres/create_tariffplan_tables.sql +++ b/data/storage/postgres/create_tariffplan_tables.sql @@ -529,6 +529,7 @@ CREATE INDEX tp_suppliers_unique ON tp_suppliers ("tpid", "tenant", "id", "initial" varchar(64) NOT NULL, "substitute" varchar(64) NOT NULL, "append" BOOLEAN NOT NULL, + "blocker" BOOLEAN NOT NULL, "weight" decimal(8,2) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE ); diff --git a/engine/responder.go b/engine/responder.go index 79ddb23bc..71eef1b64 100644 --- a/engine/responder.go +++ b/engine/responder.go @@ -46,7 +46,6 @@ type AttrGetLcr struct { type Responder struct { ExitChan chan bool CdrStats rpcclient.RpcClientConnection - AttributeS rpcclient.RpcClientConnection Timeout time.Duration Timezone string MaxComputedUsage map[string]time.Duration