mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
SessionS - cloning AttributeS event to avoid concurrency
This commit is contained in:
@@ -2084,7 +2084,7 @@ func (sS *SessionS) BiRPCv1InitiateSession(clnt rpcclient.ClientConnector,
|
||||
rplyAttr, err := sS.processAttributes(args.CGREvent, args.ArgDispatcher,
|
||||
args.AttributeIDs)
|
||||
if err == nil {
|
||||
args.CGREvent = rplyAttr.CGREvent
|
||||
args.CGREvent = rplyAttr.CGREvent.Clone() // avoid concurrency with rply.Attributes
|
||||
if tntIface, has := args.CGREvent.Event[utils.MetaTenant]; has {
|
||||
// special case when we want to overwrite the tenant
|
||||
args.CGREvent.Tenant = tntIface.(string)
|
||||
@@ -2307,7 +2307,7 @@ func (sS *SessionS) BiRPCv1UpdateSession(clnt rpcclient.ClientConnector,
|
||||
rplyAttr, err := sS.processAttributes(args.CGREvent, args.ArgDispatcher,
|
||||
args.AttributeIDs)
|
||||
if err == nil {
|
||||
args.CGREvent = rplyAttr.CGREvent
|
||||
args.CGREvent = rplyAttr.CGREvent.Clone()
|
||||
if tntIface, has := args.CGREvent.Event[utils.MetaTenant]; has {
|
||||
// special case when we want to overwrite the tenant
|
||||
args.CGREvent.Tenant = tntIface.(string)
|
||||
|
||||
Reference in New Issue
Block a user