Updated integration tests

This commit is contained in:
Trial97
2019-12-11 16:56:54 +02:00
parent bbcfc6de42
commit 49489be7a2
25 changed files with 195 additions and 129 deletions

View File

@@ -28,6 +28,7 @@ import (
"github.com/cgrates/ltcache"
)
// Cache is the global cache used
var Cache *ltcache.TransCache
func init() {
@@ -60,7 +61,7 @@ type CacheS struct {
pcItems map[string]chan struct{} // signal precaching
}
// GetChannel returns the channel used to signal precaching
// GetPrecacheChannel returns the channel used to signal precaching
func (chS *CacheS) GetPrecacheChannel(chID string) chan struct{} {
return chS.pcItems[chID]
}
@@ -81,7 +82,7 @@ func (chS *CacheS) Precache() (err error) {
utils.CacheInstanceToPrefix[cacheID], nil,
false)
if errCache != nil {
errChan <- errCache
errChan <- fmt.Errorf("precaching cacheID <%s>, got error: %s", cacheID, errCache)
}
close(chS.pcItems[cacheID])
wg.Done()

View File

@@ -170,7 +170,7 @@ func (cdrS *CDRServer) rateCDR(cdr *CDRWithArgDispatcher) ([]*CDR, error) {
if err == nil && len(smCosts) != 0 {
break
}
if i != 3 {
if i <= cdrS.cgrCfg.CdrsCfg().SMCostRetries-1 {
time.Sleep(time.Duration(fib()) * time.Second)
}
}
@@ -486,7 +486,7 @@ func (cdrS *CDRServer) processEvent(ev *utils.CGREventWithArgDispatcher,
me.GetStringIgnoreErrors(utils.CGRID),
me.GetStringIgnoreErrors(utils.RunID),
)
if Cache.HasItem(utils.CacheCDRIDs, uID) {
if Cache.HasItem(utils.CacheCDRIDs, uID) && !reRate {
utils.Logger.Warning(
fmt.Sprintf("<%s> error: <%s> processing event %+v with %s",
utils.CDRs, utils.ErrExists, utils.ToJSON(cgrEv), utils.CacheS))