mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-13 11:06:25 +05:00
convert *max/min_counter to *max/min_event_counter
this is the default behavior
This commit is contained in:
@@ -226,6 +226,10 @@ func (mig MigratorRC8) migrateAccounts() error {
|
||||
MinQueuedItems: oldAtr.MinQueuedItems,
|
||||
Executed: oldAtr.Executed,
|
||||
}
|
||||
if newAcc.ActionTriggers[index].ThresholdType == "*min_counter" ||
|
||||
newAcc.ActionTriggers[index].ThresholdType == "*max_counter" {
|
||||
newAcc.ActionTriggers[index].ThresholdType = strings.Replace(newAcc.ActionTriggers[index].ThresholdType, "_", "_event_", 1)
|
||||
}
|
||||
}
|
||||
newAccounts[keyIndex] = newAcc
|
||||
}
|
||||
@@ -286,6 +290,10 @@ func (mig MigratorRC8) migrateActionTriggers() error {
|
||||
MinQueuedItems: oldAtr.MinQueuedItems,
|
||||
Executed: oldAtr.Executed,
|
||||
}
|
||||
if newAtrs[index].ThresholdType == "*min_counter" ||
|
||||
newAtrs[index].ThresholdType == "*max_counter" {
|
||||
newAtrs[index].ThresholdType = strings.Replace(newAtrs[index].ThresholdType, "_", "_event_", 1)
|
||||
}
|
||||
}
|
||||
newAtrsMap[key] = newAtrs
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirections[8],BalanceCategories[9],BalanceDestinationTags[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingTags[14],BalanceWeight[15],BalanceDisabled[16],StatsMinQueuedItems[17],ActionsTag[18],Weight[19]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_counter,15,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_BALANCE,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,15,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_BALANCE,10
|
||||
CDRST1_WARN_ASR,,*min_asr,45,true,1h,,,,,,,,,,,,3,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACD,,*min_acd,10,true,1h,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
CDRST1_WARN_ACC,,*max_acc,10,true,10m,,,,,,,,,,,,5,CDRST_WARN_HTTP,10
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#Tag[0],UniqueId[1],ThresholdType[2],ThresholdValue[3],Recurrent[4],MinSleep[5],BalanceTag[6],BalanceType[7],BalanceDirections[8],BalanceCategories[9],BalanceDestinationIds[10],BalanceRatingSubject[11],BalanceSharedGroup[12],BalanceExpiryTime[13],BalanceTimingIds[14],BalanceWeight[15],BalanceDisabled[16],StatsMinQueuedItems[17],ActionsId[18],Weight[19]
|
||||
STANDARD_TRIGGERS,,*min_balance,2,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_event_counter,5,false,0,,*monetary,*out,,FS_USERS,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,20,false,0,,*monetary,*out,,,,,,,,,,LOG_WARNING,10
|
||||
STANDARD_TRIGGERS,,*max_balance,100,false,0,,*monetary,*out,,,,,,,,,,DISABLE_AND_LOG,10
|
||||
CDRST1_WARN,,*min_asr,45,true,1m,,,,,,,,,,,,3,LOG_WARNING,10
|
||||
|
||||
|
@@ -570,6 +570,9 @@ func (acc *Account) InitCounters() {
|
||||
continue
|
||||
}
|
||||
_, ct, _ := at.GetThresholdTypeInfo()
|
||||
if ct == "" {
|
||||
ct = utils.COUNTER_EVENT
|
||||
}
|
||||
uc, exists := ucTempMap[at.BalanceType+ct]
|
||||
if !exists {
|
||||
uc = &UnitCounter{
|
||||
|
||||
Reference in New Issue
Block a user