From 462dc17aaae4f38e839dd549b38049e08d16a091 Mon Sep 17 00:00:00 2001 From: TeoV Date: Mon, 19 Oct 2020 16:41:52 +0300 Subject: [PATCH] Update integration test for apier/v2 --- apier/v2/cdrs_it_test.go | 4 ++-- data/conf/samples/cdrsv2internal/cgrates.json | 1 - data/conf/samples/cdrsv2mongo/cgrates.json | 1 - data/conf/samples/cdrsv2mongo_gob/cgrates.json | 1 - data/conf/samples/cdrsv2mysql/cdrsv2mysql.json | 1 - data/conf/samples/cdrsv2mysql_gob/cdrsv2mysql.json | 1 - data/conf/samples/cdrsv2psql/cdrsv2psql.json | 1 - engine/thresholds.go | 4 ++-- 8 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apier/v2/cdrs_it_test.go b/apier/v2/cdrs_it_test.go index 170b8c578..98cf1fbbf 100644 --- a/apier/v2/cdrs_it_test.go +++ b/apier/v2/cdrs_it_test.go @@ -59,7 +59,7 @@ var ( testV2CDRsGetCdrsNoRattingPlan, testV2CDRsRateCDRsWithRatingPlan, - testV2CDRsGetCdrsWithRattingPlan, + testV2CDRsGetCdrsWithRatingPlan, testV2CDRsSetThreshold, testV2CDRsProcessCDRWithThreshold, @@ -674,7 +674,7 @@ func testV2CDRsRateCDRsWithRatingPlan(t *testing.T) { } } -func testV2CDRsGetCdrsWithRattingPlan(t *testing.T) { +func testV2CDRsGetCdrsWithRatingPlan(t *testing.T) { var cdrCnt int64 req := utils.AttrGetCdrs{} if err := cdrsRpc.Call(utils.APIerSv2CountCDRs, &req, &cdrCnt); err != nil { diff --git a/data/conf/samples/cdrsv2internal/cgrates.json b/data/conf/samples/cdrsv2internal/cgrates.json index e30280fdf..30f56ffa2 100644 --- a/data/conf/samples/cdrsv2internal/cgrates.json +++ b/data/conf/samples/cdrsv2internal/cgrates.json @@ -16,7 +16,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["*localhost"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/data/conf/samples/cdrsv2mongo/cgrates.json b/data/conf/samples/cdrsv2mongo/cgrates.json index 77c3c081b..dfc79a466 100644 --- a/data/conf/samples/cdrsv2mongo/cgrates.json +++ b/data/conf/samples/cdrsv2mongo/cgrates.json @@ -16,7 +16,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["*localhost"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/data/conf/samples/cdrsv2mongo_gob/cgrates.json b/data/conf/samples/cdrsv2mongo_gob/cgrates.json index db7858367..671d4c6a9 100644 --- a/data/conf/samples/cdrsv2mongo_gob/cgrates.json +++ b/data/conf/samples/cdrsv2mongo_gob/cgrates.json @@ -25,7 +25,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["conn1"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json b/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json index 99cc5e872..e698054d5 100644 --- a/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json +++ b/data/conf/samples/cdrsv2mysql/cdrsv2mysql.json @@ -16,7 +16,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["*localhost"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/data/conf/samples/cdrsv2mysql_gob/cdrsv2mysql.json b/data/conf/samples/cdrsv2mysql_gob/cdrsv2mysql.json index e75472e84..0fd049816 100644 --- a/data/conf/samples/cdrsv2mysql_gob/cdrsv2mysql.json +++ b/data/conf/samples/cdrsv2mysql_gob/cdrsv2mysql.json @@ -24,7 +24,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["conn1"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/data/conf/samples/cdrsv2psql/cdrsv2psql.json b/data/conf/samples/cdrsv2psql/cdrsv2psql.json index fcca99d62..8c67d43f2 100644 --- a/data/conf/samples/cdrsv2psql/cdrsv2psql.json +++ b/data/conf/samples/cdrsv2psql/cdrsv2psql.json @@ -16,7 +16,6 @@ "rals": { "enabled": true, - "thresholds_conns": ["*localhost"], "dynaprepaid_actionplans": ["PACKAGE_1001"], }, diff --git a/engine/thresholds.go b/engine/thresholds.go index 9e4eeb516..8e070656a 100644 --- a/engine/thresholds.go +++ b/engine/thresholds.go @@ -189,7 +189,7 @@ func (tS *ThresholdService) runBackup() { // storeThresholds represents one task of complete backup func (tS *ThresholdService) storeThresholds() { var failedTdIDs []string - for { // don't stop untill we store all dirty resources + for { // don't stop until we store all dirty resources tS.stMux.Lock() tID := tS.storedTdIDs.GetOne() if tID != "" { @@ -200,7 +200,7 @@ func (tS *ThresholdService) storeThresholds() { break // no more keys, backup completed } if tIf, ok := Cache.Get(utils.CacheThresholds, tID); !ok || tIf == nil { - utils.Logger.Warning(fmt.Sprintf(" failed retrieving from cache resource with ID: %s", tID)) + utils.Logger.Warning(fmt.Sprintf(" failed retrieving from cache treshold with ID: %s", tID)) } else if err := tS.StoreThreshold(tIf.(*Threshold)); err != nil { failedTdIDs = append(failedTdIDs, tID) // record failure so we can schedule it for next backup }