mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Updated *none request type handling
This commit is contained in:
committed by
Dan Christian Bogos
parent
13cd8e8a99
commit
912a124b7c
@@ -290,8 +290,8 @@ func testSSv1ItProcessEventInitiateSession(t *testing.T) {
|
||||
expMaxUsage := map[string]time.Duration{
|
||||
"CustomerCharges": initUsage,
|
||||
"SupplierCharges": initUsage,
|
||||
// "raw": initUsage,
|
||||
utils.MetaRaw: initUsage,
|
||||
"raw": initUsage,
|
||||
utils.MetaRaw: initUsage,
|
||||
}
|
||||
if !reflect.DeepEqual(expMaxUsage, rply.MaxUsage) {
|
||||
t.Errorf("Expected %s received %s", expMaxUsage, rply.MaxUsage)
|
||||
@@ -395,8 +395,8 @@ func testSSv1ItProcessEventUpdateSession(t *testing.T) {
|
||||
expMaxUsage := map[string]time.Duration{
|
||||
"CustomerCharges": reqUsage,
|
||||
"SupplierCharges": reqUsage,
|
||||
// "raw": reqUsage,
|
||||
utils.MetaRaw: reqUsage,
|
||||
"raw": reqUsage,
|
||||
utils.MetaRaw: reqUsage,
|
||||
}
|
||||
if !reflect.DeepEqual(expMaxUsage, rply.MaxUsage) {
|
||||
t.Errorf("Expected %s received %s", expMaxUsage, rply.MaxUsage)
|
||||
|
||||
@@ -38,7 +38,7 @@ func MatchingItemIDsForEvent(ev utils.MapStorage, stringFldIDs, prefixFldIDs, su
|
||||
}
|
||||
// Guard will protect the function with automatic locking
|
||||
lockID := utils.CacheInstanceToPrefix[cacheID] + itemIDPrefix
|
||||
guardian.Guardian.Guard(func() (gRes interface{}, gErr error) {
|
||||
guardian.Guardian.Guard(func() (_ interface{}, _ error) {
|
||||
if !indexedSelects {
|
||||
var keysWithID []string
|
||||
if keysWithID, err = dm.DataDB().GetKeysForPrefix(utils.CacheIndexesToPrefix[cacheID]); err != nil {
|
||||
@@ -58,7 +58,8 @@ func MatchingItemIDsForEvent(ev utils.MapStorage, stringFldIDs, prefixFldIDs, su
|
||||
fieldIDs = &allFieldIDs
|
||||
}
|
||||
for _, fldName := range *fieldIDs {
|
||||
fieldValIf, err := ev.FieldAsInterface(strings.Split(fldName, utils.NestingSep))
|
||||
var fieldValIf interface{}
|
||||
fieldValIf, err = ev.FieldAsInterface(strings.Split(fldName, utils.NestingSep))
|
||||
if err != nil && filterIndexTypes[i] != utils.MetaNone {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ cgrates (0.11.0~dev) UNRELEASED; urgency=medium
|
||||
* [Templates] Added support for multiple indexes
|
||||
* [AgentS] Added ~*req prefix for freeswitch extra_fields
|
||||
* [AgentS] Changed NavigableMap with DataNode for speed improvements
|
||||
* [SessionS] RequestType *none returns back the requested usage
|
||||
|
||||
-- DanB <danb@cgrates.org> Wed, 19 Feb 2020 13:25:52 +0200
|
||||
|
||||
|
||||
@@ -1502,6 +1502,7 @@ func (sS *SessionS) updateSession(s *Session, updtEv, opts engine.MapEvent, isMs
|
||||
for i, sr := range s.SRuns {
|
||||
reqType := sr.Event.GetStringIgnoreErrors(utils.RequestType)
|
||||
if reqType == utils.MetaNone {
|
||||
maxUsage[sr.CD.RunID] = reqMaxUsage
|
||||
continue
|
||||
}
|
||||
var rplyMaxUsage time.Duration
|
||||
|
||||
Reference in New Issue
Block a user