For *internalDB check store internal only when services are enabled

This commit is contained in:
TeoV
2019-11-25 09:31:36 +02:00
parent ff5b7d9b59
commit bb793a4d50
4 changed files with 10 additions and 23 deletions

View File

@@ -705,13 +705,13 @@ func (cfg *CGRConfig) checkConfigSanity() error {
return fmt.Errorf("<%s> %s needs to be 0 when DataBD is *internal, received : %d", utils.CacheS, key, config.Limit)
}
}
if cfg.resourceSCfg.StoreInterval != -1 {
if cfg.resourceSCfg.Enabled == true && cfg.resourceSCfg.StoreInterval != -1 {
return fmt.Errorf("<%s> StoreInterval needs to be -1 when DataBD is *internal, received : %d", utils.ResourceS, cfg.resourceSCfg.StoreInterval)
}
if cfg.statsCfg.StoreInterval != -1 {
if cfg.statsCfg.Enabled == true && cfg.statsCfg.StoreInterval != -1 {
return fmt.Errorf("<%s> StoreInterval needs to be -1 when DataBD is *internal, received : %d", utils.StatS, cfg.statsCfg.StoreInterval)
}
if cfg.thresholdSCfg.StoreInterval != -1 {
if cfg.thresholdSCfg.Enabled == true && cfg.thresholdSCfg.StoreInterval != -1 {
return fmt.Errorf("<%s> StoreInterval needs to be -1 when DataBD is *internal, received : %d", utils.ThresholdS, cfg.thresholdSCfg.StoreInterval)
}
}

View File

@@ -37,18 +37,6 @@
},
"resources": {
"store_interval": "-1"
},
"stats": {
"store_interval": "-1"
},
"thresholds": {
"store_interval": "-1"
},
"apier": {
"scheduler_conns": [ // connections to SchedulerS for reloads
{"address": "*internal"},

View File

@@ -75,13 +75,10 @@
],
},
"stats": {
"enabled": false,
"store_interval": "-1",
},
"scheduler": {
"enabled": true,
},
}

View File

@@ -75,8 +75,10 @@
],
},
"stats": {
"enabled": false,
"store_interval": "-1",
}
"scheduler": {
"enabled": true,
},
}