From 0e4ae73958b21b6e02550038fdaadb5ed5be6dbf Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Tue, 27 Jul 2021 17:14:54 +0300 Subject: [PATCH] Fix typo loopStoped -> loopStopped --- config/config_defaults.go | 2 +- cores/server.go | 4 ++-- data/conf/cgrates/cgrates.json | 2 +- docs/tut_cgrates_usage.rst | 2 +- engine/resources.go | 10 +++++----- engine/stats.go | 10 +++++----- engine/thresholds.go | 10 +++++----- general_tests/redis_cluster_it_test.go | 2 +- general_tests/sentinel_it_test.go | 2 +- scheduler/scheduler.go | 2 +- services/kamailioagent_it_test.go | 2 +- 11 files changed, 24 insertions(+), 24 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index 3778f4347..a3de3a37c 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -60,7 +60,7 @@ const CGRATES_CFG_JSON = ` "caps": 0, // maximum concurrent request allowed ( 0 to disabled ) "caps_strategy": "*busy", // strategy in case in case of concurrent requests reached "caps_stats_interval": "0", // the interval we sample for caps stats ( 0 to disabled ) - "shutdown_timeout": "1s" // the duration to wait until all services are stoped + "shutdown_timeout": "1s" // the duration to wait until all services are stopped }, diff --git a/cores/server.go b/cores/server.go index 3dd934544..8ee8d2119 100644 --- a/cores/server.go +++ b/cores/server.go @@ -273,7 +273,7 @@ func (s *Server) ServeBiRPC(addrJSON, addrGOB string, onConn func(*rpc2.Client), } defer lgob.Close() } - <-s.stopbiRPCServer // wait until server is stoped to close the listener + <-s.stopbiRPCServer // wait until server is stopped to close the listener return } @@ -295,7 +295,7 @@ func (s *Server) acceptBiRPC(srv *rpc2.Server, l net.Listener, codecName string, return } s.stopbiRPCServer <- struct{}{} - utils.Logger.Crit(fmt.Sprintf("Stoped Bi%s server beacause %s", codecName, err)) + utils.Logger.Crit(fmt.Sprintf("Stopped Bi%s server beacause %s", codecName, err)) return // stop if we get Accept error } go srv.ServeCodec(newCodec(conn, s.caps, s.anz)) diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index 929af5d31..b8f3fdacd 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -39,7 +39,7 @@ // "caps": 0, // maximum concurrent request allowed ( 0 to disabled ) // "caps_strategy": "*busy", // strategy in case in case of concurrent requests reached // "caps_stats_interval": "0", // the interval we sample for caps stats ( 0 to disabled ) -// "shutdown_timeout": "1s" // the duration to wait until all services are stoped +// "shutdown_timeout": "1s" // the duration to wait until all services are stopped // }, diff --git a/docs/tut_cgrates_usage.rst b/docs/tut_cgrates_usage.rst index 5c1c945ca..67c018921 100644 --- a/docs/tut_cgrates_usage.rst +++ b/docs/tut_cgrates_usage.rst @@ -55,7 +55,7 @@ Test calls Since the user 1001 is marked as *prepaid* inside the telecom switch, calling between 1001 and 1002 should generate pre-auth and prepaid debits which can be checked with *get_account* command integrated within *cgr-console* tool. Charging will be done based on time of day as described in the tariff plan definition above. -*Note*: An important particularity to note here is the ability of **CGRateS** SessionManager to refund units booked in advance (eg: if debit occurs every 10s and rate increments are set to 1s, the SessionManager will be smart enough to refund pre-booked credits for calls stoped in the middle of debit interval). +*Note*: An important particularity to note here is the ability of **CGRateS** SessionManager to refund units booked in advance (eg: if debit occurs every 10s and rate increments are set to 1s, the SessionManager will be smart enough to refund pre-booked credits for calls stopped in the middle of debit interval). Check that 1001 balance is properly deducted, during the call, and moreover considering that general balance has priority over the shared one debits for this call should take place at first out of general balance. diff --git a/engine/resources.go b/engine/resources.go index 558a3e514..e8af073ed 100644 --- a/engine/resources.go +++ b/engine/resources.go @@ -370,7 +370,7 @@ func NewResourceService(dm *DataManager, cgrcfg *config.CGRConfig, storedResources: make(utils.StringSet), cgrcfg: cgrcfg, filterS: filterS, - loopStoped: make(chan struct{}), + loopStopped: make(chan struct{}), stopBackup: make(chan struct{}), connMgr: connMgr, } @@ -385,14 +385,14 @@ type ResourceService struct { srMux sync.RWMutex // protects storedResources cgrcfg *config.CGRConfig stopBackup chan struct{} // control storing process - loopStoped chan struct{} + loopStopped chan struct{} connMgr *ConnManager } // Reload stops the backupLoop and restarts it func (rS *ResourceService) Reload() { close(rS.stopBackup) - <-rS.loopStoped // wait until the loop is done + <-rS.loopStopped // wait until the loop is done rS.stopBackup = make(chan struct{}) go rS.runBackup() } @@ -414,14 +414,14 @@ func (rS *ResourceService) Shutdown() { func (rS *ResourceService) runBackup() { storeInterval := rS.cgrcfg.ResourceSCfg().StoreInterval if storeInterval <= 0 { - rS.loopStoped <- struct{}{} + rS.loopStopped <- struct{}{} return } for { rS.storeResources() select { case <-rS.stopBackup: - rS.loopStoped <- struct{}{} + rS.loopStopped <- struct{}{} return case <-time.After(storeInterval): } diff --git a/engine/stats.go b/engine/stats.go index 21755a4ed..611bc8fd7 100644 --- a/engine/stats.go +++ b/engine/stats.go @@ -38,7 +38,7 @@ func NewStatService(dm *DataManager, cgrcfg *config.CGRConfig, filterS: filterS, cgrcfg: cgrcfg, storedStatQueues: make(utils.StringSet), - loopStoped: make(chan struct{}), + loopStopped: make(chan struct{}), stopBackup: make(chan struct{}), } } @@ -49,7 +49,7 @@ type StatService struct { connMgr *ConnManager filterS *FilterS cgrcfg *config.CGRConfig - loopStoped chan struct{} + loopStopped chan struct{} stopBackup chan struct{} storedStatQueues utils.StringSet // keep a record of stats which need saving, map[statsTenantID]bool ssqMux sync.RWMutex // protects storedStatQueues @@ -58,7 +58,7 @@ type StatService struct { // Reload stops the backupLoop and restarts it func (sS *StatService) Reload() { close(sS.stopBackup) - <-sS.loopStoped // wait until the loop is done + <-sS.loopStopped // wait until the loop is done sS.stopBackup = make(chan struct{}) go sS.runBackup() } @@ -80,14 +80,14 @@ func (sS *StatService) Shutdown() { func (sS *StatService) runBackup() { storeInterval := sS.cgrcfg.StatSCfg().StoreInterval if storeInterval <= 0 { - sS.loopStoped <- struct{}{} + sS.loopStopped <- struct{}{} return } for { sS.storeStats() select { case <-sS.stopBackup: - sS.loopStoped <- struct{}{} + sS.loopStopped <- struct{}{} return case <-time.After(storeInterval): } diff --git a/engine/thresholds.go b/engine/thresholds.go index 5c075d545..8930edad7 100644 --- a/engine/thresholds.go +++ b/engine/thresholds.go @@ -209,7 +209,7 @@ func NewThresholdService(dm *DataManager, cgrcfg *config.CGRConfig, filterS *Fil cgrcfg: cgrcfg, filterS: filterS, stopBackup: make(chan struct{}), - loopStoped: make(chan struct{}), + loopStopped: make(chan struct{}), storedTdIDs: make(utils.StringSet), } } @@ -220,7 +220,7 @@ type ThresholdService struct { cgrcfg *config.CGRConfig filterS *FilterS stopBackup chan struct{} - loopStoped chan struct{} + loopStopped chan struct{} storedTdIDs utils.StringSet // keep a record of stats which need saving, map[statsTenantID]bool stMux sync.RWMutex // protects storedTdIDs } @@ -228,7 +228,7 @@ type ThresholdService struct { // Reload stops the backupLoop and restarts it func (tS *ThresholdService) Reload() { close(tS.stopBackup) - <-tS.loopStoped // wait until the loop is done + <-tS.loopStopped // wait until the loop is done tS.stopBackup = make(chan struct{}) go tS.runBackup() } @@ -250,14 +250,14 @@ func (tS *ThresholdService) Shutdown() { func (tS *ThresholdService) runBackup() { storeInterval := tS.cgrcfg.ThresholdSCfg().StoreInterval if storeInterval <= 0 { - tS.loopStoped <- struct{}{} + tS.loopStopped <- struct{}{} return } for { tS.storeThresholds() select { case <-tS.stopBackup: - tS.loopStoped <- struct{}{} + tS.loopStopped <- struct{}{} return case <-time.After(storeInterval): } diff --git a/general_tests/redis_cluster_it_test.go b/general_tests/redis_cluster_it_test.go index c09301625..19fe30c3a 100644 --- a/general_tests/redis_cluster_it_test.go +++ b/general_tests/redis_cluster_it_test.go @@ -49,7 +49,7 @@ import ( * - configure the cluster with the following command: * `./redis-trib.rb create --replicas 1 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 127.0.0.1:7006` * - * To run the tests you need to specify the `redisCluster` flag and have the redis stoped: + * To run the tests you need to specify the `redisCluster` flag and have the redis stopped: * `go test github.com/cgrates/cgrates/general_tests -tags=integration -dbtype=*mysql -run=TestRedisCluster -redisCluster -v` * * The configuration of the cluster is the following: diff --git a/general_tests/sentinel_it_test.go b/general_tests/sentinel_it_test.go index aa253cb37..e5645a305 100644 --- a/general_tests/sentinel_it_test.go +++ b/general_tests/sentinel_it_test.go @@ -67,7 +67,7 @@ var ( // Node2 will be slave of node1 and start at port 16380 // Sentinel1 will be started at port 16381 and will watch Node1 // Sentinel2 will be started at port 16382 and will watch Node1 -// Also make sure that redis process is stoped +// Also make sure that redis process is stopped func TestRedisSentinel(t *testing.T) { if !*redisSentinel { return diff --git a/scheduler/scheduler.go b/scheduler/scheduler.go index c83046f9d..d1b703640 100644 --- a/scheduler/scheduler.go +++ b/scheduler/scheduler.go @@ -160,7 +160,7 @@ func (s *Scheduler) loadTasks() { utils.SchedulerS, err.Error(), s.cfg.SchedulerCfg().Filters, task.ActionsID, task.AccountID)) } // we do not push the task back as this may cause an infinite loop - // push it when the function is done and we stoped the for + // push it when the function is done and we stopped the for // do not use defer here as the functions are exeucted // from the last one to the first unexecutedTasks = append(unexecutedTasks, task) diff --git a/services/kamailioagent_it_test.go b/services/kamailioagent_it_test.go index 89d6424b8..383520efb 100644 --- a/services/kamailioagent_it_test.go +++ b/services/kamailioagent_it_test.go @@ -97,7 +97,7 @@ func TestKamailioAgentReload(t *testing.T) { t.Fatalf("\nExpected <%+v>, \nReceived <%+v>", nil, err) } time.Sleep(10 * time.Millisecond) //need to switch to gorutine - // the engine should be stoped as we could not connect to kamailio + // the engine should be stopped as we could not connect to kamailio shdChan.CloseOnce() time.Sleep(10 * time.Millisecond)