mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-16 13:49:53 +05:00
Made ThresholdSv1ProcessEvent run in go routine for Account and Balance publish action
This commit is contained in:
committed by
Dan Christian Bogos
parent
64ce90cf3f
commit
c17b4c08a7
@@ -1093,8 +1093,8 @@ func (acnt *Account) Publish() {
|
||||
utils.AllowNegative: acnt.AllowNegative,
|
||||
utils.Disabled: acnt.Disabled}}
|
||||
if statS != nil {
|
||||
var reply []string
|
||||
go func() {
|
||||
var reply []string
|
||||
if err := statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
@@ -1104,13 +1104,15 @@ func (acnt *Account) Publish() {
|
||||
}()
|
||||
}
|
||||
if thresholdS != nil {
|
||||
var tIDs []string
|
||||
if err := thresholdS.Call(utils.ThresholdSv1ProcessEvent,
|
||||
&ArgsProcessEvent{CGREvent: cgrEv}, &tIDs); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<AccountS> error: %s processing account event %+v with ThresholdS.", err.Error(), cgrEv))
|
||||
}
|
||||
go func() {
|
||||
var tIDs []string
|
||||
if err := thresholdS.Call(utils.ThresholdSv1ProcessEvent,
|
||||
&ArgsProcessEvent{CGREvent: cgrEv}, &tIDs); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<AccountS> error: %s processing account event %+v with ThresholdS.", err.Error(), cgrEv))
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -703,8 +703,8 @@ func (b *Balance) Publish() {
|
||||
cgrEv.Event[utils.ExpiryTime] = b.ExpirationDate.Format(time.RFC3339)
|
||||
}
|
||||
if statS != nil {
|
||||
var reply []string
|
||||
go func() {
|
||||
var reply []string
|
||||
if err := statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
@@ -714,13 +714,15 @@ func (b *Balance) Publish() {
|
||||
}()
|
||||
}
|
||||
if thresholdS != nil {
|
||||
var tIDs []string
|
||||
if err := thresholdS.Call(utils.ThresholdSv1ProcessEvent, &ArgsProcessEvent{CGREvent: cgrEv}, &tIDs); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<AccountS> error: %s processing balance event %+v with ThresholdS.",
|
||||
err.Error(), cgrEv))
|
||||
}
|
||||
go func() {
|
||||
var tIDs []string
|
||||
if err := thresholdS.Call(utils.ThresholdSv1ProcessEvent, &ArgsProcessEvent{CGREvent: cgrEv}, &tIDs); err != nil &&
|
||||
err.Error() != utils.ErrNotFound.Error() {
|
||||
utils.Logger.Warning(
|
||||
fmt.Sprintf("<AccountS> error: %s processing balance event %+v with ThresholdS.",
|
||||
err.Error(), cgrEv))
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user