mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
cgr-loader default path take now correctly
This commit is contained in:
committed by
Dan Christian Bogos
parent
ee1c0cc619
commit
811dfbe20f
@@ -118,6 +118,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Data for DataDB
|
||||
if *dataDBType != dfltCfg.DataDbCfg().DataDbType {
|
||||
ldrCfg.DataDbCfg().DataDbType = *dataDBType
|
||||
}
|
||||
@@ -146,6 +147,11 @@ func main() {
|
||||
ldrCfg.DataDbCfg().DataDbSentinelName = *dbRedisSentinel
|
||||
}
|
||||
|
||||
if *dbDataEncoding != dfltCfg.GeneralCfg().DBDataEncoding {
|
||||
ldrCfg.GeneralCfg().DBDataEncoding = *dbDataEncoding
|
||||
}
|
||||
|
||||
// Data for StorDB
|
||||
if *storDBType != dfltCfg.StorDbCfg().StorDBType {
|
||||
ldrCfg.StorDbCfg().StorDBType = *storDBType
|
||||
}
|
||||
@@ -166,19 +172,15 @@ func main() {
|
||||
ldrCfg.StorDbCfg().StorDBUser = *storDBUser
|
||||
}
|
||||
|
||||
if *storDBPasswd != "" {
|
||||
if *storDBPasswd != dfltCfg.StorDbCfg().StorDBPass {
|
||||
ldrCfg.StorDbCfg().StorDBPass = *storDBPasswd
|
||||
}
|
||||
|
||||
if *dbDataEncoding != "" {
|
||||
ldrCfg.GeneralCfg().DBDataEncoding = *dbDataEncoding
|
||||
}
|
||||
|
||||
if *tpid != "" {
|
||||
if *tpid != dfltCfg.LoaderCgrCfg().DataPath {
|
||||
ldrCfg.LoaderCgrCfg().TpID = *tpid
|
||||
}
|
||||
|
||||
if *dataPath != "" {
|
||||
if *dataPath != dfltCfg.LoaderCgrCfg().DataPath {
|
||||
ldrCfg.LoaderCgrCfg().DataPath = *dataPath
|
||||
}
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ const CGRATES_CFG_JSON = `
|
||||
|
||||
"loader": { // loader for tariff plans out of .csv files
|
||||
"tpid": "", // tariff plan identificator
|
||||
"data_path": "", // path towards tariff plan files
|
||||
"data_path": "./", // path towards tariff plan files
|
||||
"disable_reverse": false, // disable reverse computing
|
||||
"field_separator": ",", // separator used in case of csv files
|
||||
"caches_conns":[ // addresses towards cacheS components for reloads
|
||||
|
||||
@@ -1331,7 +1331,7 @@ func TestDfDispatcherSJsonCfg(t *testing.T) {
|
||||
func TestDfLoaderCfg(t *testing.T) {
|
||||
eCfg := &LoaderCfgJson{
|
||||
Tpid: utils.StringPointer(""),
|
||||
Data_path: utils.StringPointer(""),
|
||||
Data_path: utils.StringPointer("./"),
|
||||
Disable_reverse: utils.BoolPointer(false),
|
||||
Field_separator: utils.StringPointer(","),
|
||||
Caches_conns: &[]*HaPoolJsonCfg{
|
||||
|
||||
@@ -1464,7 +1464,7 @@ func TestCgrCfgJSONDefaultDispatcherSCfg(t *testing.T) {
|
||||
func TestCgrLoaderCfgDefault(t *testing.T) {
|
||||
eLdrCfg := &LoaderCgrCfg{
|
||||
TpID: "",
|
||||
DataPath: "",
|
||||
DataPath: "./",
|
||||
DisableReverse: false,
|
||||
FieldSeparator: rune(','),
|
||||
CachesConns: []*HaPoolConfig{
|
||||
|
||||
Reference in New Issue
Block a user