Renamed "cgr.lock" to ".cgr.lock" and put both in and out dirs in the same for loop

This commit is contained in:
Anevo
2018-03-20 05:40:40 -04:00
committed by Dan Christian Bogos
parent b43ffcd7be
commit 524d9c1f66
4 changed files with 4 additions and 9 deletions

View File

@@ -479,12 +479,7 @@ func (self *CGRConfig) checkConfigSanity() error {
if !ldrSCfg.Enabled {
continue
}
for _, dir := range []string{ldrSCfg.TpInDir} {
if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
fmt.Errorf("Nonexistent folder: %s", dir)
}
}
for _, dir := range []string{ldrSCfg.TpOutDir} {
for _, dir := range []string{ldrSCfg.TpInDir, ldrSCfg.TpOutDir} {
if _, err := os.Stat(dir); err != nil && os.IsNotExist(err) {
fmt.Errorf("Nonexistent folder: %s", dir)
}

View File

@@ -458,7 +458,7 @@ const CGRATES_CFG_JSON = `
"enabled": false, // starts as service: <true|false>.
"dry_run": false, // do not send the CDRs to CDRS, just parse them
"run_delay": 0, // sleep interval in seconds between consecutive runs, 0 to use automation via inotify
"lock_filename": "cgr.lock", // Filename containing concurrency lock in case of delayed processing
"lock_filename": ".cgr.lock", // Filename containing concurrency lock in case of delayed processing
"caches_conns": [
{"address": "*internal"}, // address where to reach the CacheS for data reload, empty for no reloads <""|*internal|x.y.z.y:1234>
],

View File

@@ -815,7 +815,7 @@ func TestDfLoaderSJsonCfg(t *testing.T) {
Enabled: utils.BoolPointer(false),
Dry_run: utils.BoolPointer(false),
Run_delay: utils.IntPointer(0),
Lock_filename: utils.StringPointer("cgr.lock"),
Lock_filename: utils.StringPointer(".cgr.lock"),
Caches_conns: &[]*HaPoolJsonCfg{&HaPoolJsonCfg{
Address: utils.StringPointer(utils.MetaInternal),
}},

View File

@@ -923,7 +923,7 @@ func TestLoaderDefaults(t *testing.T) {
Enabled: false,
DryRun: false,
RunDelay: 0,
LockFileName: "cgr.lock",
LockFileName: ".cgr.lock",
CacheSConns: []*HaPoolConfig{
&HaPoolConfig{
Address: utils.MetaInternal,