Rename in session ProcessThreshold -> ProcessThresholds

This commit is contained in:
TeoV
2018-03-06 08:13:41 -05:00
committed by Dan Christian Bogos
parent 053224e639
commit bb9c5400eb
3 changed files with 24 additions and 18 deletions

View File

@@ -399,7 +399,7 @@ func (fsev FSEvent) V1AuthorizeArgs() (args *sessions.V1AuthorizeArgs) {
args.GetAttributes = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}
@@ -434,7 +434,7 @@ func (fsev FSEvent) V1InitSessionArgs() (args *sessions.V1InitSessionArgs) {
args.GetAttributes = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}
@@ -466,7 +466,7 @@ func (fsev FSEvent) V1TerminateSessionArgs() (args *sessions.V1TerminateSessionA
args.ReleaseResources = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}

View File

@@ -245,7 +245,7 @@ func (kev KamEvent) V1AuthorizeArgs() (args *sessions.V1AuthorizeArgs) {
args.GetAttributes = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}
@@ -277,7 +277,7 @@ func (kev KamEvent) AsKamAuthReply(authArgs *sessions.V1AuthorizeArgs,
if authArgs.GetSuppliers && authReply.Suppliers != nil {
kar.Suppliers = authReply.Suppliers.Digest()
}
if authArgs.ProcessThreshold != nil && *authArgs.ProcessThreshold {
if authArgs.ProcessThresholds != nil && *authArgs.ProcessThresholds {
kar.ThresholdHits = *authReply.ThresholdHits
}
return
@@ -333,7 +333,7 @@ func (kev KamEvent) V1InitSessionArgs() (args *sessions.V1InitSessionArgs) {
args.GetAttributes = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}
@@ -385,7 +385,7 @@ func (kev KamEvent) V1TerminateSessionArgs() (args *sessions.V1TerminateSessionA
args.ReleaseResources = true
}
if strings.Index(subsystems, utils.MetaThresholds) != -1 {
args.ProcessThreshold = utils.BoolPointer(true)
args.ProcessThresholds = utils.BoolPointer(true)
}
return
}

View File

@@ -1295,7 +1295,7 @@ type V1AuthorizeArgs struct {
AuthorizeResources bool
GetMaxUsage bool
GetSuppliers bool
ProcessThreshold *bool
ProcessThresholds *bool
utils.CGREvent
utils.Paginator
}
@@ -1329,6 +1329,9 @@ func (v1AuthReply *V1AuthorizeReply) AsCGRReply() (cgrReply utils.CGRReply, err
if v1AuthReply.Suppliers != nil {
cgrReply["Suppliers"] = v1AuthReply.Suppliers.Digest()
}
if v1AuthReply.ThresholdHits != nil {
cgrReply["ThresholdHits"] = *v1AuthReply.ThresholdHits
}
return
}
@@ -1405,8 +1408,8 @@ func (smg *SMGeneric) BiRPCv1AuthorizeEvent(clnt rpcclient.RpcClientConnection,
}
}
checkThresholds := smg.thdS != nil
if args.ProcessThreshold != nil {
checkThresholds = *args.ProcessThreshold
if args.ProcessThresholds != nil {
checkThresholds = *args.ProcessThresholds
}
if checkThresholds {
if smg.thdS == nil {
@@ -1464,7 +1467,7 @@ type V1InitSessionArgs struct {
GetAttributes bool
AllocateResources bool
InitSession bool
ProcessThreshold *bool
ProcessThresholds *bool
utils.CGREvent
}
@@ -1493,6 +1496,9 @@ func (v1Rply *V1InitSessionReply) AsCGRReply() (cgrReply utils.CGRReply, err err
if v1Rply.MaxUsage != nil {
cgrReply["MaxUsage"] = *v1Rply.MaxUsage
}
if v1Rply.ThresholdHits != nil {
cgrReply["ThresholdHits"] = *v1Rply.ThresholdHits
}
return
}
@@ -1549,8 +1555,8 @@ func (smg *SMGeneric) BiRPCv1InitiateSession(clnt rpcclient.RpcClientConnection,
}
}
checkThresholds := smg.thdS != nil
if args.ProcessThreshold != nil {
checkThresholds = *args.ProcessThreshold
if args.ProcessThresholds != nil {
checkThresholds = *args.ProcessThresholds
}
if checkThresholds {
if smg.thdS == nil {
@@ -1635,9 +1641,9 @@ func (smg *SMGeneric) BiRPCv1UpdateSession(clnt rpcclient.RpcClientConnection,
}
type V1TerminateSessionArgs struct {
TerminateSession bool
ReleaseResources bool
ProcessThreshold *bool
TerminateSession bool
ReleaseResources bool
ProcessThresholds *bool
utils.CGREvent
}
@@ -1675,8 +1681,8 @@ func (smg *SMGeneric) BiRPCv1TerminateSession(clnt rpcclient.RpcClientConnection
}
}
checkThresholds := smg.thdS != nil
if args.ProcessThreshold != nil {
checkThresholds = *args.ProcessThreshold
if args.ProcessThresholds != nil {
checkThresholds = *args.ProcessThresholds
}
if checkThresholds {
if smg.thdS == nil {