mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 11:06:25 +05:00
fix init counters
This commit is contained in:
@@ -563,7 +563,7 @@ func (acc *Account) countUnits(amount float64, kind string, cc *CallCost, b *Bal
|
||||
|
||||
// Create counters for all triggered actions
|
||||
func (acc *Account) InitCounters() {
|
||||
acc.UnitCounters = make(UnitCounters, 0)
|
||||
acc.UnitCounters = nil
|
||||
ucTempMap := make(map[string]*UnitCounter)
|
||||
for _, at := range acc.ActionTriggers {
|
||||
if !strings.Contains(at.ThresholdType, "counter") {
|
||||
|
||||
@@ -67,7 +67,7 @@ ENABLE_ACNT,*enable_account,,,,,,,,,,,,,false,10`
|
||||
t.Error(err)
|
||||
} else if acnt == nil {
|
||||
t.Error("No account created")
|
||||
} else if !reflect.DeepEqual(expectAcnt, acnt) {
|
||||
} else if !reflect.DeepEqual(expectAcnt.ActionTriggers, acnt.ActionTriggers) {
|
||||
t.Errorf("Expecting: %+v, received: %+v", expectAcnt, acnt)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user