mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Fix balance thresholds not being executed
This commit is contained in:
@@ -328,7 +328,7 @@ func (ub *Account) executeActionTriggers(a *Action) {
|
||||
for _, at := range ub.ActionTriggers {
|
||||
// sanity check
|
||||
if !strings.Contains(at.ThresholdType, "counter") &&
|
||||
strings.Contains(at.ThresholdType, "balance") {
|
||||
!strings.Contains(at.ThresholdType, "balance") {
|
||||
continue
|
||||
}
|
||||
if at.Executed {
|
||||
|
||||
@@ -241,7 +241,7 @@ func (at *ActionTiming) Execute() (err error) {
|
||||
} else if ub.Disabled {
|
||||
return 0, fmt.Errorf("User %s is disabled", ubId)
|
||||
}
|
||||
Logger.Info(fmt.Sprintf("Executing %v on %v", a.ActionType, ub.Id))
|
||||
//Logger.Info(fmt.Sprintf("Executing %v on %v", a.ActionType, ub.Id))
|
||||
err = actionFunction(ub, nil, a)
|
||||
accountingStorage.SetAccount(ub)
|
||||
return 0, nil
|
||||
|
||||
@@ -77,7 +77,7 @@ func (at *ActionTrigger) Execute(ub *Account, sq *StatsQueue) (err error) {
|
||||
Logger.Warning(fmt.Sprintf("Function type %v not available, aborting execution!", a.ActionType))
|
||||
return
|
||||
}
|
||||
go Logger.Info(fmt.Sprintf("Executing %v, %v: %v", ub, sq, a))
|
||||
//go Logger.Info(fmt.Sprintf("Executing %v, %v: %v", ub, sq, a))
|
||||
err = actionFunction(ub, sq, a)
|
||||
if err == nil {
|
||||
atLeastOneActionExecuted = true
|
||||
|
||||
Reference in New Issue
Block a user