convert *max/min_counter to *max/min_event_counter

this is the default behavior
This commit is contained in:
Radu Ioan Fericean
2015-11-03 18:43:12 +02:00
parent 233b4b0b4a
commit 1f20539bb3
4 changed files with 13 additions and 2 deletions

View File

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