From 524d9c1f66d5212580e8eb5c025be90470669af4 Mon Sep 17 00:00:00 2001 From: Anevo Date: Tue, 20 Mar 2018 05:40:40 -0400 Subject: [PATCH] Renamed "cgr.lock" to ".cgr.lock" and put both in and out dirs in the same for loop --- config/config.go | 7 +------ config/config_defaults.go | 2 +- config/config_json_test.go | 2 +- config/config_test.go | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/config/config.go b/config/config.go index aaa1a4316..445602c81 100755 --- a/config/config.go +++ b/config/config.go @@ -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) } diff --git a/config/config_defaults.go b/config/config_defaults.go index 8398684d6..27cf001bf 100755 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -458,7 +458,7 @@ const CGRATES_CFG_JSON = ` "enabled": false, // starts as service: . "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> ], diff --git a/config/config_json_test.go b/config/config_json_test.go index ed14ec400..cc0d148d0 100755 --- a/config/config_json_test.go +++ b/config/config_json_test.go @@ -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), }}, diff --git a/config/config_test.go b/config/config_test.go index 8beabcdaa..2b592d67d 100755 --- a/config/config_test.go +++ b/config/config_test.go @@ -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,