Update account and balance Publish method

This commit is contained in:
TeoV
2018-09-21 03:18:36 -04:00
committed by Dan Christian Bogos
parent cbd60bd5ed
commit 8f3a96e3e4
4 changed files with 20 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ In a nutshell all the dependencies are installed and used from a folder named *v
First we have to setup the GO Lang to our OS. Feel free to download
the latest GO binary release from https://golang.org/dl/
In this Tutorial we are going to install Go 1.11.0.
In this Tutorial we are going to install Go 1.11
::

View File

@@ -1085,12 +1085,19 @@ func (acnt *Account) Publish() {
utils.Account: acntTnt.ID,
utils.AllowNegative: acnt.AllowNegative,
utils.Disabled: acnt.Disabled}}
var tIDs []string
if statS != nil {
var reply []string
go statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply)
go func() {
if err := statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply); err != nil &&
err.Error() != utils.ErrNotFound.Error() {
utils.Logger.Warning(
fmt.Sprintf("<AccountS> error: %s processing balance event %+v with StatS.",
err.Error(), cgrEv))
}
}()
}
if thresholdS != nil {
var tIDs []string
if err := thresholdS.Call(utils.ThresholdSv1ProcessEvent,
&ArgsProcessEvent{CGREvent: cgrEv}, &tIDs); err != nil &&
err.Error() != utils.ErrNotFound.Error() {

View File

@@ -715,10 +715,17 @@ func (b *Balance) Publish() {
}
if statS != nil {
var reply []string
go statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply)
go func() {
if err := statS.Call(utils.StatSv1ProcessEvent, &StatsArgsProcessEvent{CGREvent: cgrEv}, &reply); err != nil &&
err.Error() != utils.ErrNotFound.Error() {
utils.Logger.Warning(
fmt.Sprintf("<AccountS> error: %s processing balance event %+v with StatS.",
err.Error(), cgrEv))
}
}()
}
var tIDs []string
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(

View File

@@ -281,7 +281,7 @@ func (smg *SMGeneric) ttlTerminate(s *SMGSession, tmtr *smgSessionTerminator) {
cdr.Usage = s.TotalUsage
var reply string
cgrEv := &utils.CGREvent{
Tenant: s.EventStart.GetStringIgnoreErrors(utils.Tenant),
Tenant: s.Tenant,
ID: utils.UUIDSha1Prefix(),
Event: cdr.AsMapStringIface(),
}