mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Update account and balance Publish method
This commit is contained in:
committed by
Dan Christian Bogos
parent
cbd60bd5ed
commit
8f3a96e3e4
@@ -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
|
||||
|
||||
::
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user