mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-17 06:09:53 +05:00
Allow nonexistent default configuration folder
This commit is contained in:
@@ -518,7 +518,7 @@ func main() {
|
||||
}
|
||||
go startCdrc(cdrsChan, cdrcCfgs, cfg.HttpSkipTlsVerify, cdrServer, cfg.ConfigReloads[utils.CDRC])
|
||||
}
|
||||
if len(cfg.CdrcProfiles) != 0 {
|
||||
if cdrcEnabled {
|
||||
engine.Logger.Info("Starting CGRateS CDR client.")
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ func NewCGRConfigFromFolder(cfgDir string) (*CGRConfig, error) {
|
||||
}
|
||||
fi, err := os.Stat(cfgDir)
|
||||
if err != nil {
|
||||
if strings.HasSuffix(err.Error(), "no such file or directory") {
|
||||
return cfg, nil
|
||||
}
|
||||
return nil, err
|
||||
} else if !fi.IsDir() && cfgDir != utils.CONFIG_DIR { // If config dir defined, needs to exist, not checking for default
|
||||
return nil, fmt.Errorf("Path: %s not a directory.", cfgDir)
|
||||
|
||||
Reference in New Issue
Block a user