Fix balance thresholds not being executed

This commit is contained in:
DanB
2014-08-02 21:13:11 +02:00
parent a290a6aa6e
commit a48fa90dd8
6 changed files with 50 additions and 50 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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