From f06e3446c89f560873f583f91a4c9ef09e819b5b Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Mon, 6 Sep 2021 14:54:55 +0300 Subject: [PATCH] Remove const, adjust error messages and fix formatting in config --- config/config_defaults.go | 2 +- config/configsanity.go | 2 +- config/configsanity_test.go | 2 +- utils/consts.go | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index bfad4b081..4232e8aaf 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -661,7 +661,7 @@ const CGRATES_CFG_JSON = ` "enabled": false, // starts attribute service: "stats_conns": [], // connections to StatS, empty to disable: <""|*internal|$rpc_conns_id> "resources_conns": [], // connections to ResourceS, empty to disable: <""|*internal|$rpc_conns_id> - "accounts_conns": [], // connections to AccountS, empty to disable: <""|*internal|$rpc_conns_id> + "accounts_conns": [], // connections to AccountS, empty to disable: <""|*internal|$rpc_conns_id> "indexed_selects": true, // enable profile matching exclusively on indexes //"string_indexed_fields": [], // query indexes based on these fields for faster processing "prefix_indexed_fields": [], // query indexes based on these fields for faster processing diff --git a/config/configsanity.go b/config/configsanity.go index 442ca10b2..86f785bdb 100644 --- a/config/configsanity.go +++ b/config/configsanity.go @@ -549,7 +549,7 @@ func (cfg *CGRConfig) checkConfigSanity() error { return fmt.Errorf("<%s> invalid type", utils.AttributeS) } if processRuns < 1 { - return fmt.Errorf("<%s> process_runs needs to be bigger than 0", utils.AttributeS) + return fmt.Errorf("<%s> processRuns needs to be bigger than 0", utils.AttributeS) } } if cfg.chargerSCfg.Enabled { diff --git a/config/configsanity_test.go b/config/configsanity_test.go index 79dbcf55d..74c111504 100644 --- a/config/configsanity_test.go +++ b/config/configsanity_test.go @@ -991,7 +991,7 @@ func TestConfigSanityAttributesCfg(t *testing.T) { utils.OptsAttributesProcessRuns: float64(0), }, } - expected := " process_runs needs to be bigger than 0" + expected := " processRuns needs to be bigger than 0" if err := cfg.checkConfigSanity(); err == nil || err.Error() != expected { t.Errorf("Expecting: %+q received: %+q", expected, err) } diff --git a/utils/consts.go b/utils/consts.go index 2c21fc472..011152ee4 100644 --- a/utils/consts.go +++ b/utils/consts.go @@ -1873,7 +1873,6 @@ const ( // AttributeSCfg IndexedSelectsCfg = "indexed_selects" - ProcessRunsCfg = "process_runs" ProfileRunsCfg = "profile_runs" NestedFieldsCfg = "nested_fields"